python |
Pythonタグが付けられた新着投稿 - Qiita |
[Slack App] 動的にメッセージを更新するテクニック |
https://qiita.com/player_ppp/items/b6d6d887d051fa6ff70f
|
slack |
2022-06-06 21:15:42 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
Railsでmigrationかけた後にブランチをチェックアウトしてしまった時の復旧方法 |
https://qiita.com/yoshiki_murakami/items/871aa7b6eb4f1e4b62cc
|
migrate |
2022-06-06 21:44:27 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
【Laravel】ページが見つかりません |
https://qiita.com/monaka33/items/4463ff72a9f8e1f4045f
|
environmentnamephp |
2022-06-06 21:53:53 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
【Git】ローカルからリモートリポジトリのブランチが確認できない |
https://qiita.com/monaka33/items/f53b59987b44de8b659e
|
ctrlshiftp |
2022-06-06 21:32:37 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
【自分用】GitHubを用いた開発の流れを整理する。 |
https://qiita.com/hondano_gentuki/items/a972bdeb414e86721a65
|
github |
2022-06-06 21:13:23 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
Railsでmigrationかけた後にブランチをチェックアウトしてしまった時の復旧方法 |
https://qiita.com/yoshiki_murakami/items/871aa7b6eb4f1e4b62cc
|
migrate |
2022-06-06 21:44:27 |
海外TECH |
MakeUseOf |
The 5 Best Shared Inbox Apps for Team Emails |
https://www.makeuseof.com/best-shared-inbox-apps-team-emails/
|
The Best Shared Inbox Apps for Team EmailsIf you re looking for a shared inbox app for your team s emails the options can be confusing To help make your choice here are five of the best |
2022-06-06 12:30:14 |
海外TECH |
MakeUseOf |
Connecteam: The Ultimate People Management App |
https://www.makeuseof.com/connecteam-people-management-app/
|
depth |
2022-06-06 12:30:13 |
海外TECH |
MakeUseOf |
Facebook Symbol Meanings, Explained (And How to Use Them Properly) |
https://www.makeuseof.com/tag/guide-facebook-symbols/
|
Facebook Symbol Meanings Explained And How to Use Them Properly Facebook is filled with symbols whether it s on your post options or navigation menus Here are their meanings and how to use them |
2022-06-06 12:05:14 |
海外TECH |
DEV Community |
A Playbook to Properly Implement Pay As You Go Pricing |
https://dev.to/moesif/a-playbook-to-properly-implement-pay-as-you-go-pricing-k9g
|
A Playbook to Properly Implement Pay As You Go PricingUsage based pricing consumption based pricing and PAYG Pay As You Go are relatively new SaaS pricing models that enable you to drive both top of line growth while also increasing net revenue retention over more traditional subscription pricing models such as license or seat based pricing With Pay As You Go a customer only needs to pay for what they consume such as hours of a VM or number of messages sent APIs naturally are transaction based which make them suitable for new consumption based pricing In fact all three cloud providers AWS Google and Azure leverage consumption based billing so their customers can optimize their infrastructure Prepaid vs postpaid billingFirst you ll want to decide whether you want prepaid or a postpaid billing Prepaid billing requires the customer to purchase credits or pre negotiated quota ahead of time creating a positive balance that is then burned down If they are credits a customer will need to periodically top off their account by purchasing additional credits before they run out Some systems enable automatic top off once a balance falls below a defined threshold This can improve your business cash flow since you re able to leverage the spent capital even before any costs are incurred to deliver their service Irrespective of Pay As You Go most enterprise companies require enterprise contracts to be prepaid for the term as prepaid enables more payment options such as a bank wire or ACH Customers also benefit since they can set hard budgets for your service and disable any auto top off functionality The downside to prepaid billing is the additional friction added when purchasing a plan when usage is not predictable especially if it s not a bundled amount Prepaid billing requires the customer to estimate how much to purchase even before even using the service which can also cause more refund requests if they don t end up using the credits Unless a card is on file collecting additional fees due to overage or term violations may be harder Customers may be opposed to prepaid billing since the capital is tied up This can be especially true for growth oriented spend such as pay per click advertising or credit card processing In these cases a customer may be willing to pay a higher price since they already collected the revenue from their users A third option is to leverage a hybrid of both For example a bundled amount could be prepaid on a credit card but then overage fees are post paid Billing frequencyYou will also need to decide how often a customer is billed which is related to whether you leverage prepay vs postpay billing One option is to invoice periodically such as the nth day of the month This makes it easier on your customers billing department as your service more predictable while minimizing extra work to pay invoices This is also easier to understand as most SaaS subscriptions are already billed annually or monthly It s not recommended to have a common billing day for all customers like the start or end of a month as this can cause your support team to deal with a flood of billing requests on that day notice info A second option is threshold based If prepaid billing a customer needs to purchase credits which in turn needs to be topped off once the balance drops below a threshold Many systems allow this to charge a card automatically such as When the balance drops below add worth of credits If you implement postpaid billing the threshold is simply the reverse in that when the negative balance goes above a threshold such as an invoice is generated and credit card charged This is increasingly common in self serve advertising The downside is a lack of predictability since some months could have many more charges than other months If not careful this can generate an unnecessary number of invoices with small charges Similarly this can cause a nightmare for your accounting team and harder to predict future revenue Billing measurementBased on your billing time and frequency you will need to implement a system that can accurately measure and report on transaction volume for each customer account This usually means having an analytics system on API calls or transactions Because each customer may have a different billing period your analytics solution should have a way to handle this If you leverage periodic billing then you can query a customer s usage when you invoice them which is usually on a predefined billing day For threshold billing measurement may be a little more tricky since an invoice can be generated at any time not just on the customer s billing day This means you need to keep track and trigger invoices once the threshold is reached Leveraging a ready made API analytics tool like Moesif can reduce your development and maintenance time drastically vs a custom in house billing Quota emailsWhen it comes to pricing customers don t want surprises Yet with consumption based billing invoice amounts can vary depending on their usage By sending automated quota and usage emails your customers can stay informed when their cost increases or they approach a quota limit If you leverage a hybrid model such as a bundled fee and an overage fee you may want to remind customers once they used the majority of their quota or when they exceeded it A behavioral email platform like Moesif can be configured to silence notifications for a period like days one a customer gets alerted to avoid spamming your customer s inboxes Then after days if a customer is still exceeding the limits you can send a second email Self serve billing dashboardsBecause you are billing based on usage it s imperative to provide your customers with visibility into these usage and success metrics in a self serve way Rather than force your customers to ask for support just to understand how much quota they used you can embed metrics right inside your developer portal with a tool like Moesif s embedded charts Your customers will want to slice and dice this data so that they can understand where their usage is going and where they can save money Requirements for usage reports include Ability to see usage by different intervals like hourly daily or monthly Shows number of business transactions even if your API can handle requests in batchA way to break usage down by user demographics or clients Beyond usage reports you can also embed other metrics like SLA API logs and more to improve your developer experience and reduce barriers to adopting your API platform ConclusionPay As You Go pricing can drive both revenue and retention for your business with implemented properly Yet consumption based billing is also more challenging to implement than more traditional subscription pricing You need accurate measurement of usage and also workflows to ensure your customers are not surprised once they receive an invoice Tools like embedded charts and quota emails can go a long ways to keeping your customers informed Do you want to know how customers use your APIs Try Moesif API Analytics This article was originally written for the Moesif blog by Derric Gilling CEO and founder of Moesif API Analytics |
2022-06-06 12:50:43 |
海外TECH |
DEV Community |
Meme Monday! |
https://dev.to/ben/meme-monday-1h1
|
Meme Monday Welcome to the second Meme Monday post Today s cover image comes from my favorite submission from last week s thread DEV is an inclusive space Humor in poor taste will be downvoted by mods |
2022-06-06 12:48:16 |
海外TECH |
DEV Community |
Kubernetes monitoring with open-source tools [OpenTelemetry and SigNoz] |
https://dev.to/signoz/kubernetes-monitoring-with-open-source-tools-opentelemetry-and-signoz-3obl
|
Kubernetes monitoring with open source tools OpenTelemetry and SigNoz Kubernetes monitoring is a critical process for keeping your Kubernetes clusters running in fine health In this tutorial we will learn everything about Kubernetes monitoring We will be using two open source tools OpenTelemetry and SigNoz to monitor a Kubernetes cluster so you can follow along with the tutorial easily Containerization technologies like Docker and Kubernetes have solved many engineering problems like on demand scaling and deploying new applications but it also brings a lot of operational complexity Modern distributed applications deployed using Kubernetes have too many moving parts and cluster operators need a monitoring tool to run their clusters effectively In this tutorial we will be using open source tools OpenTelemetry and SigNoz to monitor a Kubernetes cluster With open source tools you are more in control of your data Furthermore if there are privacy laws you can deploy the tools on prem so that there is no need to send the data to any cloud vendor Why monitor your Kubernetes cluster Kubernetes makes it easy to deploy and operate applications in a microservice architecture However as the number of microservices increases your Kubernetes cluster also becomes quite complex to manage Cluster operators need to take care of a lot of things like running the desired number of pods utilization of cluster resources and misconfigurations Monitoring tools can help cluster operators proactively manage their clusters by reporting on critical metrics But traditional monitoring tools are often inadequate to monitor the dynamic environment of a Kubernetes cluster Modern monitoring tools should enable engineering teams to set up an observability framework for their infrastructure including Kubernetes clusters Observability is a term from control theory which states that a system is observable if the internal states of the system can be determined by examining its output For observability in computing systems these output signals are commonly divided into three major categories logs metrics and traces OpenTelemetry is an instrumentation layer for cloud native applications that aims to generate and collect these output signals Before we deep dive into the tutorial for Kubernetes monitoring let s have a brief overview of OpenTelemetry and SigNoz What is OpenTelemetry OpenTelemetry also known as OTel for short is an open source vendor agnostic set of tools APIs and SDKs used to instrument applications to create and manage telemetry data metrics traces and logs It is backed by Cloud Native Computing Foundation the same foundation under which Kubernetes graduated OpenTelemetry aims to make telemetry data a built in feature of cloud native software applications The telemetry data is then sent to a backend analysis tool for storage and visualization OpenTelemetry can be used to generate metrics from Kubernetes clusters OpenTelemetry is the bedrock for setting up an observability framework It is backed by a huge community and it is quietly becoming the world standard for instrumentation of cloud native applications It also provides you the freedom to choose a backend analysis tool of your choice And that s where SigNoz comes into the picture OpenTelemetry and SigNozIn this article we will use SigNoz a full stack open source application monitoring and observability platform that can be used for storing and visualizing the telemetry data collected with OpenTelemetry It is built natively on OpenTelemetry and works on the various data formats OTLP Zipkin Jaeger Prometheus backends etc SigNoz provides query and visualization capabilities for the end user and comes with out of box charts for application metrics and traces OpenTelemetry and SigNoz can help you monitor important metrics from your Kubernetes cluster What should I monitor in Kubernetes Monitoring your Kubernetes cluster effectively is necessary to keep your containerized infrastructure running properly The first step is to decide which metrics to monitor for your Kubernetes cluster The important components that need to be monitored in a Kubernetes cluster include Node level metricsPod level metricsContainer level metricsWith OpenTelemetry and SigNoz you can collect and visualize these metrics easily Now let s get down to some action and see everything for yourself We will divide the tutorial into two parts Installing SigNozKubernetes Infrastructure Monitoring Installing SigNozFirst you need to install SigNoz so that OpenTelemetry can send the collected data to it SigNoz can be installed on Kubernetes easily using Helm helm repo add signoz kubectl create ns platformhelm namespace platform install my release signoz signozYou should see similar output NAME my releaseLAST DEPLOYED Mon May NAMESPACE platformSTATUS deployedREVISION NOTES You have just deployed SigNoz cluster frontend version query service version alertmanager version otel collector version otel collector metrics version For detailed instructions to set up SigNoz cluster in Kubernetes please refer to our documentation To port forward SigNoz UI on your local machine run the following kubectl port forward n platform service my release signoz frontend When you are done installing SigNoz you can access the UI at http localhost You can alternatively set the SigNoz Frontend service type as LoadBalancer NodePort or use Ingress for the custom domain Now that you have SigNoz up and running it s time to set up OpenTelemetry Collectors for your Kubernetes cluster OpenTelemetry Collector is a component of OpenTelemetry that helps to collect process and export the telemetry data You can enable sampling and export data in multiple formats using OpenTelemetry collectors Kubernetes Infrastructure monitoringOpenTelemetry uses receivers to collect data in specified formats A receiver is how data gets into the OpenTelemetry Collector Generally a receiver accepts data in a specified format and translates it into the internal format to be consumed by OpenTelemetry We will use the following receivers of the OpenTelemetry collector to collect metrics from the Kubernetes cluster kubeletstats Kubelet Stats Receiver pulls pod metrics from the API server on a kubelethostmetrics Host Metrics receiver generates metrics about the host system Steps to export Kubernetes metrics to SigNozStep Clone Otel collector repogit clone amp amp cd otel collector ksStep Set up the address to SigNoz in your OTel collectorsYou need to set up the address to SigNoz in your OTel collector which is collecting the ks metrics If you are running SigNoz in an independent Kubernetes cluster or VM you need to change the placeholder IPs in the following files with the IP of machine where you are hosting SigNoz agent infra metrics yamldeployment all in one yamlYou need to update the below section exporters otlp endpoint lt SigNoz Otel Collector Address gt tls insecure trueIf you are running SigNoz in the same Kubernetes cluster where your applications are you have to replace the above endpoint in agent infra metrics yaml and deployment all in one yaml bymy release signoz otel collector platform svc cluster local In the above code snippet my release is the Helm release nameplatform is the namespace where SigNoz is deployedIn case of SigNoz installed in different kubernetes cluster machine update it to the appropriate address Step Install OTel collectors and enable specific receivers to send metrics to SigNozTo access metrics from kubeletstats receivers you have to kubectl create ns signoz infra metricskubectl n signoz infra metrics apply Rf agentkubectl n signoz infra metrics apply Rf deploymentThe output will be something like this namespace signoz infra metrics createddaemonset apps otel collector agent createdconfigmap otel collector agent conf createdserviceaccount sa otel agent createdclusterrole rbac authorization ks io sa otel agent role createdclusterrolebinding rbac authorization ks io aoc agent role binding createdconfigmap otelcontribcol createdserviceaccount otelcontribcol createdclusterrole rbac authorization ks io otelcontribcol createdclusterrolebinding rbac authorization ks io otelcontribcol createddeployment apps otelcontribcol createdTo check pod status kubectl n signoz infra metrics get podsThe output will be something like this NAME READY STATUS RESTARTS AGEotel collector agent kkchn Running motelcontribcol dcc tkk Running mTo check logs of the OTel collector agent export POD NAME kubectl n signoz infra metrics get pods l component otel collector agent o jsonpath items metadata name kubectl n signoz infra metrics logs POD NAMEOutput should look like this T Z info service telemetry go Setting up own telemetry T Z info service telemetry go Serving Prometheus metrics address level basic service instance id c c e c dcbdf service version latest T Z info service collector go Starting otelcol contrib Version NumCPU T Z info service collector go Everything is ready Begin running and processing data In case of any errors in the above logs you should not see except for the case of SigNoz being unavailable or inaccessible Step Plot Metrics in SigNoz UIIf the previous step was a success you should be able to plot graphs from the list of kubelet metrics follow these instructions to create dashboards and widgets Monitor Kubelet Metrics with SigNozYou can get started easily for monitoring Kubelet metrics with SigNoz All you have to do is to import a JSON file and you will get out of box charts for your Kubelet metrics Under the Dashboards tab of SigNoz click on New Dashboard and then Import JSON Import a JSON file to get started with monitoring your Kubelet metricsThe Kubelet metrics dashboard will give you stats about CPU and memory metrics of the Kubernetes cluster Monitor Kubelet metrics with SigNozYou can include more widgets using other metrics to the dashboard as per your requirements Monitor Node Metrics of your Kubernetes clusterNode metrics are very important as we have nodes underneath the abstraction of Kubernetes container orchestration Similar to the previous section we will be importing JSON files to create dashboards of our node metrics We will be using the hostmetrics receiver of OTel collector to build these dashboards There are many nodes in a Kubernetes cluster Hence we will be creating multiple dashboards for each node SigNoz will add support for label widgets in the future which would make it possible to monitor all nodes using a single dashboard Let s run the following commands to generate hostmetrics dashboard JSON files for each node automatically for node in kubectl get nodes o name sed e s node do curl sL HOSTNAME node DASHBOARD TITLE HostMetrics Dashboard for node bashdoneAfter importing the generated dashboard JSON you should be able to see the dashboard for your node metrics Node metrics monitoring with SigNoz ConclusionUsing OpenTelemetry and SigNoz you can set up a robust monitoring framework for your Kubernetes cluster OpenTelemetry is the future for setting up observability for cloud native apps It is backed by a huge community and covers a wide variety of technology and frameworks Using OpenTelemetry engineering teams can easily monitor their infrastructure and application instrument polyglot and distributed applications with peace of mind You can then use SigNoz to store and visualize your telemetry data SigNoz is an open source observability tool that comes with a SaaS like experience You can try out SigNoz by visiting its GitHub repo If you have any questions or need any help in setting things up join our slack community and ping us in the support channel Further ReadingSigNoz an open source alternative to DataDogDistributed Tracing in a Golang application |
2022-06-06 12:28:14 |
海外TECH |
DEV Community |
What I learned about writing and workflow during the pandemic |
https://dev.to/wesen/what-i-learned-about-writing-and-workflow-during-the-pandemic-4mi5
|
What I learned about writing and workflow during the pandemicOver the last years I have been working at getting better at writing and communication I started using the gorgeous Bear application on my iPad Using beautiful tools has always inspired me so much so that I will often go for looks over functionality Bear is not only gorgeous it also comes with a big bag of features markdown tags wiki style linking apple watch app beautiful exports automatic syncing As I was getting to know Bear I experimented with different kinds of writing Having found a productive workflow as a musician over the pandemic I tried to apply the concepts that worked for me in the studio to my new endeavor Daily processThe most important part of being productive making music was to sit down and do some work everyday even if just for one hour Over time the consistent work accrues and you reap seemingly enormous benefits while never really having felt the need for inspiration to strike or having to do long grueling sessions The advantage of doing consistent short sessions is that it never feels bad to stop when things get frustrating you did your work for the day tomorrow will bring new joy I divided this creative workflow in roughly four big activities Collecting and janitorial workThe first area is what I call process the janitorial part It is learning new techniques searching for samples recording field recordings making patch collections preset sounds sorting files wiring things up with cables installing software updates This is stuff that you absolutely don t want to do when in the middle of a more creative session as it is a sure way to bring you out of the flow For writing it means note taking gathering reference material picking up and jotting down random ideas collecting quotes I started taking notes for articles I came across the internet making little entries for topics I knew things about all loosely connected through wiki links While researching Bear and note taking I came across Andy Matuschak s work and the ide aof keeping a Zettelkasten to which I will come back to in a future post I started keeping smaller atomic notes and cross linking them I used tags to keep my notes organized I ultimately migrated from Bear to Obsidian for managing my notes more about this in a future article and you can see a public part of my vault at mnml s vault Creating raw materialThe next activity is creating raw material Musically this would be coming up with beats song ideas recording synth progressions It is not about making a song it is about having fun making music in a very restricted context In fact the more restrictions are placed on the activity the easier it is to get started A prompt would for example be make beats with this one set of drum sounds Often a seemingly banal restriction would spark inspiration and I would go on for hours Freeform writingCreating raw written material means finding ways to deal with the fear of the blank page In order to turn off the internal critic I practiced writing in a stream of consciousness style without worries about the outcome I wrote free form about software architecture about bugs I was encountering about project planning ideas Over time getting into the writing zone became effortless The times I start feeling paralyzed I usually am anxious about the final form of what I am trying to write Keep a collection of promptsI keep a long list of prompts for example Blog ideas for blog articles for different areas I have a long list of prompts for work related topics different technologies that could be interesting marketing ideas broader thoughts about product and workflow links to articles I found interesting If I feel stuck or can t seem to find a way to create a seedling I will choose a prompt in one of my ideas documents and try to write down a stream of consciousness about it Using daily notesIn order to separate writing from an outcome I do most of my writing in a daily note It is completely free form and I will often paste images drawings website captures conversations along with longer segments of writing I keep it messy for a reason purposely not try to make things tidy or think about a potential reader Copy pasting chat threadsInterestingly another technique for creating raw material that works for me is just copy pasting the long ramblings I post on various chat apps and social media pages It is a variant of the rubberduck technique in that here thinking about a reader actually stimulates creativity I need to feel like I am having a conversation in order to refine my ideas I would often paste slack screenshots or twitter threads into my notes Taking notes on the goFinally the apple watch of Bear app was invaluable I usually have a lot of ideas while riding my bike or running and with the watch I could easily record these straight into my daily note The speech recognition was always a bit of a mess and I learnt over time to take much longer notes than I thought would be necessary at the time Nothing worse than coming back to a note that says bathroom architecture tomato pixie and have no idea what that was supposed to mean Properly file the created material An absolutely vital part of creating raw material is to make that raw material easy to reuse in the future This means naming files correctly filing them in ways where they can be found later on adding proper metadata saving related resources nearby This is more important for music than for writing but even for writing I make sure to cleanly label my files link them in a way that makes it easy to recall them link additional documents such as project files for graphics and diagrams correctly quote referenced material I put everything on dropbox so that I can access it quickly from wherever I am even on other people s computers It also makes it easy to share work in progress if I feel like collaborating AssemblingIn the studio the next part of the process is finding different musical ideas and sounds and making them work together This is when songs start to appear The key here is to have quick recall of all the raw material created in the previous step This is where the janitorial work comes from If everything is nicely labeled well sorted backed up documented it becomes very easy to stay in the flow while assembling Having a lot of raw material also helps A fascinating thing is that musically the best ideas often come from the least inspired sessions If I was feeling very inspired and excited making beats or certain synthesizer sounds this usually meant that after a night of sleep the result sounded horribly cliche Sessions where I really had to labor to come up with something interesting provided much richer material in the long run Assembling writingI feel that writing is similar although I have much less experience in that domain Notes and raw writings need to be easily retrievable They also need to age This means that the value of an idea or a piece of writing becomes more apparent over time If something is still interesting after months or you can find it expressed in different ways in multiple notes it probably touches upon some deeper meaning Both musically and in writing I think of assembling as working with scissors and glue It is not creating as much as it is just moving things left and right and trying out different juxtapositions This is where using digital media helps tremendously Copy paste duplicate erase undo redo save copies All these things are tremendously tedious with real tape or pen and paper Furthermore using tags and wiki links and the search functionality in Bear app I could quickly retrieve my notes and turn them into bigger documents This easy recall of previous notes and references gave my writing a new depth EditingThe final part of the process is editing After heated creation and assembling a fair amount of semi finished ideas have accumulated They are raw songs or articles unfinished but roughly of the right length or longer with the main idea clearly present At this point I choose one or two of the best ideas present and I set down to work to actually finishing them This is almost mechanical work It is about editing sentences shortening paragraphs looking up references reading for flow In music it is cleaning up recordings adding missing elements mixing the sounds spatially making sure the flow and structure is correct The work is technical and requires an alert mind but it doesn t rely on inspiration You can just turn on the computer and do it a bit like doing the dishes Interestingly for outsiders this is where the magic happens It seems that all the rubbish writing the wonky sounds and ideas suddenly fall into place and turn into something magical sometimes within minutes But really the magic is in the workflow It is present in labeling notes in collecting web links in writing free flowing rubbish in assembling individual paragraphs The editing pass is akin to putting a beautiful cake into the oven and then waiting You know it will come out great if you are just careful enough to take it out at the right time Quantity over QualityIn both creating raw material and in assembling I always try to go for quantity over quality The quality of the output is not directly related to the quality of what the work that gets done at each step The quality of the output is only determined by the selection that gets done before editing and by the experience and ruthlessness of the editing itself I would say that for my music around of the material I create ultimately gets released But the are what made that worth releasing What are your techniques for writing What about you Do you have a workflow for writing Did the pandemic help you become a better writer What do you think you could improve |
2022-06-06 12:26:42 |
海外TECH |
DEV Community |
Announcing Common Ninja Storage - A Simple API For Adding Storage Capabilities to E-Commerce Apps |
https://dev.to/commonninja/announcing-common-ninja-storage-a-simple-api-for-adding-storage-capabilities-to-e-commerce-apps-2dii
|
Announcing Common Ninja Storage A Simple API For Adding Storage Capabilities to E Commerce AppsLately we built a new app for Shopify and other e commerce platforms The app allows merchants to add info labels to a product image This is very common use case as often merchants create multiple variations of a product image to highlight some of the product s features One of the features of the app is to create an image with the info labels editor we built and then to save it for future use For that purpose we needed to integrate with a storage solution such as AWS S Google Cloud Storage Azure Blob Storage etc For some reason adding this capability and understand what s the best way to save files on a cloud storage as well as code the feature end to end in both client and server sides wasn t an easy task at all although this is something I ve handled dozens of times Our stack includes React Node and AWS S Having said that here are some of the riddles we needed to solve How to send an image from a ReactJS app to a server How to accept an image file in NodeJS How to save an image to AWS S How to get the uploaded image URL How to create and manage folders for each user They all seem like a trivial questions but answering each one of them and understand how they all play together might take lots and lots of time I believe that the main issue here is that there are multiple ways to upload images from client to server base urls form data blobs So many terms while the only thing you want as the app s developer is to allow your users to upload images and files What is Common Ninja Common Ninja is a platform that allows developers to build amp monetize apps for e commerce platforms very easily With our single e commerce API you can build your app once and integrate it with multiple platforms like Shopify BigCommerce Wix WooCommerce and more There s no need to rebuild the app and make it work on every platform individually In addition Common Ninja offers a set of APIs and tools that help developers to boost up the development process and provide payments and storage solutions Announcing Common Ninja StorageCommon Ninja s Storage solution is a new and easy way for adding storage capabilities to any e commerce app Our API is simple and you can decide wither you want Common Ninja to manage your storage or to integrate it with your own AWS S bucket You may read more about the API in our docs Code ExampleWe ll publish a much more technical article soon but meanwhile just to taste how easy it is here s a quick code example from our Info Labels app developed with React amp NodeJS import React useState from react function FileUpload const selectedFile setSelectedFile useState lt string Blob gt const changeHandler event any gt setSelectedFile event target files const uploadImage async gt try const body new FormData body append file selectedFile const req await fetch api storage files method POST body const data url await req json console log File url url catch e console error Could not upload image e return lt div gt lt input type file name file onChange changeHandler gt lt div gt lt button onClick uploadImage gt Upload lt button gt lt div gt lt div gt Next in our NodeJS server we use Common Ninja s API to upload the file and return its url import Request Response Router from express import CommonNinja from commonninja node sdk const router any Router const COMMONNINJA APP ID COMMONNINJA APP SECRET process env function getCommonNinjaClient req Request if COMMONNINJA APP ID COMMONNINJA APP SECRET throw new Error Missing Common Ninja app ID or secret key return new CommonNinja appId COMMONNINJA APP ID appSecret COMMONNINJA APP SECRET accessToken req query token as string env CommonNinja envs production logs true router post api storage upload async req Request res Response gt const client getCommonNinjaClient req const result await client storage uploadFile req body file res send result data And that s it Zero effort and your users can upload images videos documents and any other file you want your app to support Learn moreIf you re not familiar with Common Ninja or how to build your first app using our API here s the previous article we wrote about it In addition you can use the following resources to learn more and get help Common Ninja DocsDiscord Community |
2022-06-06 12:18:19 |
海外TECH |
DEV Community |
Creating an animated jellyfish in JS! 👀💥 |
https://dev.to/mijim/creating-an-animated-jellyfish-in-js-39e9
|
Creating an animated jellyfish in JS It looks D right The reality is that the animation is composed only of curves in a D plane we are going to see in depth the steps that I have followed to create this effect that we can use on our websites and combine with user actions SetupTo start we will need to add the pjs library to our project and create a JS file where we will put all the necessary code We will create a canvas with a black background through the setup function in this way function setup createCanvas window innerHeight window innerHeight background frameRate stroke strokeWeight noFill The correct way to draw a circleAt the end of the setup function we will create a circle of points through a for loop that iterates the angles of the circle like this function setup const radius const centerX width const centerY height for let angle angle lt angle const x centerX radius cos radians angle const y centerY radius sin radians angle point x y We will get something like this Adding linesNow we will replace the points with lines that go from each point to the center And we change the strokeWeight from to function setup const y centerY radius sin radians angle beginShape curveVertex centerX centerY curveVertex centerX centerY curveVertex x y curveVertex x y endShape Moving the center and crushing the circleNow we would be seeing our future jellyfish from above To create a side view effect I have decided to move the center of the circle higher on the Y axis and flatten the circle creating this effect function setup const y centerY radius sin radians angle beginShape curveVertex centerX centerY curveVertex centerX centerY curveVertex x y curveVertex x y endShape Curving the linesNow our experiment begins to take on more of a jellyfish shape by adding curvature to the lines we just created To do this we will modify above all the first and last curveVertex that correspond to the anchor points of the curve function setup const y centerY radius sin radians angle beginShape curveVertex centerX centerY curveVertex centerX centerY curveVertex x y curveVertex x y endShape Adding lots of lines and noise Adding many lines lowering the opacity of each line and adding perlin noise on the Y axis we get a more organic and natural effect that already reminds us of a jellyfish function setup createCanvas window innerHeight window innerHeight background frameRate stroke strokeWeight noFill const radius const centerX width const centerY height for let angle angle lt angle const x centerX radius cos radians angle const y centerY radius sin radians angle const noiseY noise angle beginShape curveVertex centerX centerY curveVertex centerX centerY curveVertex x y noiseY curveVertex x y endShape More noise color and movement Playing with the values of our curves and with the stroke color of each line adding variation over time we created the complete effect we were looking for I leave you the complete code of the animation and I encourage you to create your own jellyfish with new shapes and colors and adding user or sound interaction Happy Coding function setup createCanvas window innerHeight window innerHeight background frameRate stroke strokeWeight noFill let i function draw i background const centerX width const centerY height const radius noise i const radius noise i strokeWeight translate for let angle angle lt angle const x centerX radius cos radians angle const y centerY radius sin radians angle noise radians angle i const noiseStrokeR noise radians angle const noiseStrokeG noise i const noiseStrokeB noise radians angle i stroke Math round noiseStrokeR Math round noiseStrokeB Math round noiseStrokeG beginShape const noiseY noise radius const noiseY noise radius i const noiseX noise radians angle i curveVertex centerX centerY curveVertex centerX centerY noiseY curveVertex x y noiseY curveVertex x noiseX y endShape for let angle angle lt angle const x centerX radius cos radians angle const x centerX radius cos radians angle const y centerY radius sin radians angle const noiseStrokeR noise angle const noiseStrokeG noise i const noiseStrokeB noise angle i stroke Math round noiseStrokeR Math round noiseStrokeB Math round noiseStrokeG strokeWeight beginShape const noiseY noise radius const noiseY noise i angle const noiseX noise radians angle i const noiseX noise radians angle i curveVertex x centerY curveVertex x centerY noiseY curveVertex x noiseX y noiseY curveVertex x noiseX y endShape |
2022-06-06 12:06:35 |
海外TECH |
Engadget |
Google's Pixel 6 Pro is $100 off at Amazon right now |
https://www.engadget.com/googles-pixel-6-pro-is-100-off-at-amazon-right-now-125157664.html?src=rss
|
Google x s Pixel Pro is off at Amazon right nowWhile we know the Google Pixel is on the horizon that knowledge isn t going to help you if you re in need of a new smartphone immediately But Amazon has a new sale on the Pixel Pro G that may be just what you re looking for You can pick up the flagship smartphone from the online retailer for right now or off its normal price That s the cheapest we ve seen the smartphone making it a good time to get all of the latest features a Google phone has to offer before the Pixel comes out Buy Pixel Pro at Amazon The Pixel Pro earned a score of from us and we consider it to be one of the best Android phones you can get Its two toned design with the horizontal camera bar may be polarizing but it s also striking and pretty slick The Pro has a inch Hz display that will automatically adjust refresh rates depending on what you re doing It also has an under display fingerprint sensor that while a tad slow provides an extra layer of security The Pro runs on Google s Tensor Processing Unit and we found it to provide excellent performance overall Along with its strong performance you can expect an equally strong battery life from the handset We managed to get over hours of use before needing to power up again One of the stand out features of Google s Pixel smartphones is the camera array and that remains the case for the Pixel Pro It has a megapixel main sensor a MP wide angle lens and a MP telephoto shooter with a X optical zoom These cameras work together to take lovely photos that are on par with those taken by the iPhone Pro s camera array Android also brings a number of handy photography features including Magic Eraser Face Unblur Long Exposure and more Yes you could save even more money and opt for the Google Pixel but you d be forging the Pro s Hz screen telephoto camera and ultra wideband chip in the process If you ve had your eye on a Pixel phone for some time now s a good opportunity to pick up the best model available right now for less Follow EngadgetDeals on Twitter for the latest tech deals and buying advice |
2022-06-06 12:51:57 |
海外TECH |
Engadget |
Etsy introduces purchase protection measures for both buyers and sellers |
https://www.engadget.com/etsy-introduces-a-purchase-protection-program-for-both-buyers-and-sellers-123036370.html?src=rss
|
Etsy introduces purchase protection measures for both buyers and sellersOnline marketplace Etsy has unveiled a new purchase protection program designed to safeguard both buyers and sellers Right now you have limited options if something else goes wrong with a purchase ーusually Etsy will send you back to the seller and let you work out problems with them Starting August st though buyers will get full refunds on purchases if they quot don t match the item description arrive damaged or never arrive quot Etsy wrote nbsp On the seller side Etsy plans to invest at least million per year to cover refunds for sellers on orders up to for issues out of their control quot This program will help buyers feel more confident when they shop from businesses on Etsy while we invest directly in our sellers to provide them an important layer of assurance quot said Etsy CEO Raina Moskowitz in a statement nbsp Angry Etsy sellers recently went on strike over fee hikes and slow support response times The company defended the increases by saying it would put the extra money back into the business rather than boosting profits On top of the million in purchase protection it recently announced million in spending to improve customer support It promised to use that money to expand its team improve live chat support and reduce response times quot Etsy s Purchase Protection program will complement our broad efforts to improve customer support increase trust signals across the user experience and maintain the integrity of our marketplace as a destination for unique and special items quot said Moskowitz Whether sellers will be convinced remains to be seen however nbsp |
2022-06-06 12:30:36 |
Cisco |
Cisco Blog |
Technology for good: Accelerating our path to a sustainable future |
https://blogs.cisco.com/innovation/technology-for-good-accelerating-our-path-to-a-sustainable-future
|
cisco |
2022-06-06 12:10:18 |
Cisco |
Cisco Blog |
Get an early start on E-rate planning |
https://blogs.cisco.com/education/get-an-early-start-on-e-rate-planning
|
library |
2022-06-06 12:00:44 |
海外科学 |
NYT > Science |
He Helped Cure the ‘London Patient’ of H.I.V. Then He Turned to Covid. |
https://www.nytimes.com/2022/06/06/science/ravindra-gupta-hiv-patient-cure-covid.html
|
He Helped Cure the London Patient of H I V Then He Turned to Covid Ravindra Gupta who led the efforts that resulted in the second case of a patient being cured of H I V was drawn into pandemic research |
2022-06-06 12:38:38 |
ニュース |
@日本経済新聞 電子版 |
エリオット、ニッケル取引めぐりLME提訴 600億円請求
https://t.co/jVE07UEuIJ |
https://twitter.com/nikkei/statuses/1533793767098298368
|
提訴 |
2022-06-06 12:51:45 |
ニュース |
@日本経済新聞 電子版 |
難敵サソリやヤマアラシを攻略する捕食者たち
https://t.co/ADJspRK6fF |
https://twitter.com/nikkei/statuses/1533792996864294913
|
攻略 |
2022-06-06 12:48:41 |
ニュース |
@日本経済新聞 電子版 |
ホームランを打った大谷翔平がカウボーイハットをかぶって祝福を受ける。今季のエンゼルスでは、この儀式が恒例に。なぜカウボーイハットなのでしょうか。そこに込められた意味をスポーツライターが解説します。
https://t.co/lC1TLXzUyk |
https://twitter.com/nikkei/statuses/1533790822604455939
|
ホームランを打った大谷翔平がカウボーイハットをかぶって祝福を受ける。 |
2022-06-06 12:40:03 |
ニュース |
@日本経済新聞 電子版 |
100均の消耗品の内容量は減少傾向。主要商品を2010年、14年と比べると約6割で量が減少。コスト削減で100円維持か、商品力アップによる単価向上か。中長期の原材料高で各社の戦略は分かれています。
https://t.co/po7K05JVHd |
https://twitter.com/nikkei/statuses/1533785792191119365
|
均の消耗品の内容量は減少傾向。 |
2022-06-06 12:20:03 |
ニュース |
BBC News - Home |
World Cup: Elis James - Wales fans' elation and guilt over Ukraine win |
https://www.bbc.co.uk/news/uk-wales-61705300?at_medium=RSS&at_campaign=KARANGA
|
world |
2022-06-06 12:33:57 |
IT |
週刊アスキー |
R6S国内大会「RJL 2022」シーズン1の王者はKAWASAKI SCARZ! 久々のオフラインで会場も大盛り上がり |
https://weekly.ascii.jp/elem/000/004/093/4093864/
|
kawasakiscarz |
2022-06-06 21:15:00 |
コメント
コメントを投稿