AWS |
lambdaタグが付けられた新着投稿 - Qiita |
Reactでaxiosを使用してAPI Gateway連携済みのLambda(Python)からOpenWeatherMap APIをFetchする |
https://qiita.com/ayumu__/items/08838b0ee231948fde40
|
axios |
2023-01-16 22:24:00 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
ja_sentence_segmenterで文章を句点区切りする(Python) |
https://qiita.com/heimaru1231/items/b6ed09d4787e4e28175a
|
jasentence |
2023-01-16 22:47:39 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
【永久保存版】複数のベクトル群同士のコサイン類似度を一気に算出する方法 |
https://qiita.com/hi-ku/items/8140a06c381479c16304
|
永久保存版 |
2023-01-16 22:14:47 |
GCP |
gcpタグが付けられた新着投稿 - Qiita |
GCPの可用性は月単位なのか年単位なのか |
https://qiita.com/kzyo/items/f652811d19598808e4ef
|
時間 |
2023-01-16 22:23:32 |
海外TECH |
DEV Community |
Deploy a Medusa Server on AWS with Microtica |
https://dev.to/medusajs/deploy-a-medusa-server-on-aws-with-microtica-4840
|
Deploy a Medusa Server on AWS with MicroticaMedusa is an open source composable commerce platform built for developers Its architecture is flexible enabling users to build bespoke commerce solutions Medusa is composed of three components A headless backend engine that holds all the logic and data of the store and exposes APIs to communicate with the admin and storefront An admin dashboard that allows store operators to manage their orders and products andA storefront which is ultimately an ecommerce website where customers can preview products and make orders What is Microtica Microtica is a developer self service platform that enables you to self host open source solutions on AWS Amazon Web Services without being a cloud expert The platform provides production ready templates for development frameworks and solutions so you can get started fast and be free from the friction of dealing with the underlying cloud complexities Using the templates you can deliver on your own AWS account and deploy applications services on Amazon EKS Elastic Kubernetes Service Why Should You Deploy Medusa Server on AWS Here are some of the reasons why it would be a good idea to deploy a Medusa js Server on AWS with Microtica s template Out of the box serverless infrastructure with FargateInfrastructure and data ownership on your AWS accountAuto scaling based on application loadAutomated git push deployments and rollbacksProduction ready solutionResource monitoring and performance insights in app PrerequisitesTo follow through with this tutorial here s a list of things you should have do Have a Git account any provider from GitHub BitBucket GitLab and CodeCommit is supported Create a Microtica account by signing up with your email or your Git account Have an AWS account to be able to deploy a React app to your AWS account You can sign up for an AWS account here Deploy a New Medusa ServerAfter creating a Microtica account click the Deploy with Microtica button to land on the Templates page where you can see a list of all production ready templates This template creates the following infrastructure resources that will be provisioned on your AWS account VPC subnets and networkingContainer infrastructure based on FargateApplication load balancerPersistent storageS bucketPostgres databaseRedis in production mode The steps to deploying a new Medusa server are outlined below Create a Git RepositoryConnect your preferred Git account Microtica will create a repository on your Git account with a default repo name medusa server Configure TemplateHere you can customize the template for your needs by providing environment variables Enter an application name and the admin credentials that will be used to create an initial admin user with which you can later sign in to your Medusa Admin Select whether you want a production Medusa Server environment or a development one In production mode this template will provision managed RDS PostgreSQL and Redis instances In development mode the template will use local SQLite and a fake Redis instance Environment variables can be updated added or configured after deployment as well Connect an AWS accountIn the last step you can select the environment in which you want to deploy the template An existing default environment called development will be preselected here or you can create a new environment Connect your AWS account when prompted This process takes only a few seconds so afterwards only choose the region you want to deploy in Deploy the Medusa Server Template to AWSFinally a deployment summary of what will be provisioned on your AWS account is presented Clicking the Deploy button will trigger a deployment of the template and start creating the infrastructure for a Medusa Server It will take about mins for the solution to be deployed on the cloud you can follow the build pipeline in real time by clicking the View Logs button Once the build process is complete a new deployment with the infrastructure resources is triggered You can follow the logs of the deployment process by clicking the View deployment button and then selecting the deployment from the list Preview the EnvironmentAfter the deployment is finished navigate to Resources → AppName → Overview and under Resource Outputs you should see the AccessUrl This is the server URL that you can use to access API endpoints Try getting the list of products using the endpoint store products The image below shows how your environment should look after deploying both templates CleanupTo remove all the resources created on your AWS account navigate to your environment → Environment Settings → Infrastructure and you ll see the Undeploy section This will clean up the resources created in AWS but you will still have the configuration in Microtica in case you want to deploy it in the cloud again Deploy an Existing Medusa ServerIf you already have an existing Medusa server repository that you want to migrate to AWS there are several changes you need to make to your source code You can follow the documentation to configure and import your Medusa server repo code Should you have any issues or questions related to Medusa then feel free to reach out to the Medusa team via Discord |
2023-01-16 13:32:33 |
海外TECH |
DEV Community |
Creating a Node.js Command-line Tool, Linux Terminal CLI and NPM Package |
https://dev.to/basskibo/creating-a-nodejs-command-line-tool-linux-terminal-cli-and-npm-package-50na
|
Creating a Node js Command line Tool Linux Terminal CLI and NPM Package IntroductionCommand line tools are incredibly useful for automating repetitive tasks performing quick checks and for developers to perform different tasks In this tutorial we will go through the process of creating a Node js command line tool converting it into a Linux terminal CLI tool and packaging it as an npm package Creating a Node js CLINode js provides a built in fs file system and readline modules to read and write files as well as the process object to access command line arguments Here is an example of a simple command line tool that takes two arguments a file path and a string and writes the string to the file const fs require fs const readline require readline const filePath process argv const string process argv fs writeFile filePath string err gt if err console error err return console log Successfully wrote to filePath You can run this script using the command node script js path to file Hello World You can also use npm package commander to make more complex command line tool with lot of options and sub commands const program require commander program version description A simple command line tool option o output lt file gt output file parse process argv console log program output You can run the above script using the command node script js o path to file Converting to a Linux Terminal CLI ToolTo make a Linux terminal command line tool you can use the same methods as mentioned earlier to create a Node js script that accepts command line arguments and performs the desired functionality However to make the script executable in the terminal as a command you need to add a shebang line at the top of your script file and make the file executable The shebang line is the first line of the script and should be in the following format usr bin env nodeThis tells the operating system that the script should be executed using the Node js interpreter Then you need to make your script file executable by running the following command in the terminal chmod x script jsAfter that you can move the script file to a directory that is in your system s PATH and you can run the script as a command from anywhere in the terminal mv script js usr local bin your commandNow you can run your command from anywhere in the terminal using your command Packaging as an npm packageOnce you have a functioning Node js command line tool you can package it as an npm package To do this you first need to have a Node js project that you want to package The project should have a package json file which contains information about the package such as its name version and dependencies You can create a package json file by running the following command in your project s root directory npm initThis command will prompt you for information about your package such as its name and version and will create a package json file in your project s root directory Once you have a package json file you can add your code files and other necessary files to your package Make sure that the main file of your package is specified in the main field of package json You can then use the npm pack command to create a tarball of your package which can be published to the npm registry or distributed manually npm packTo publish your package to the npm registry you will need to have an account on npm and be logged in You can do this by running the following command npm loginOnce you are logged in you can use thenpm publish command to publish your package to the npm registry npm publishIt s important to note that once you have published a package with a specific version you cannot publish another package with the same name and version If you need to make changes to your package you will need to increment the version number in your package json file and republish the package If you want to check npm publishing step by step you can check my other post Simple Steps to Creating Your Very Own npm Module Creating a Node js Command line Tool Linux Terminal CLI and NPM Package Command line tools are incredibly useful for automating repetitive tasks performing quick checks and for developers to perform different tasks In this tutorial we will go through the process of creating a Node js command line tool bojanjagetic com or earlier post on dev to Simple Steps to Creating Your Very Own npm Module Bojan Jagetic・Jan ・ min read javascript webdev npm beginners ConclusionIn conclusion creating a Node js command line tool is a great way to automate repetitive tasks and perform quick checks By converting it into a Linux terminal CLI tool and packaging it as an npm package you can easily share your tool with others and make it easy for them to use With the help of fs and readline modules you can easily read and write files and access command line arguments Additionally you can use the commander npm package to make more complex command line tools with a lot of options and sub commands Once you have a functioning Node js command line tool you can package it as an npm package and share it on npm registry This allows other developers to easily install and use your tool in their own projects |
2023-01-16 13:05:24 |
海外TECH |
DEV Community |
Understanding and Implementing State Management in React: A Beginner's Guide |
https://dev.to/abhaysinghr1/understanding-and-implementing-state-management-in-react-a-beginners-guide-55he
|
Understanding and Implementing State Management in React A Beginner x s GuideState management is an important aspect of building applications with React It allows you to keep track of the current state of your application and update it in response to user interactions or other events In this blog post we will explore the basics of state management in React and learn how to implement it in a simple application First let s start by understanding what state is in the context of a React application In React state refers to the data that a component needs to render its view For example a component that displays a list of items would need to know what items to display and a component that allows a user to enter text would need to know what text is currently entered State can be stored in a variety of places in a React application One of the most common ways is to store state directly in a component s state object The state object is a plain JavaScript object that can be used to store any data that a component needs to render its view For example the following component has a state object that contains a single property text which is used to store the current text entered by the user class MyComponent extends React Component constructor props super props this state text render return type text value this state text onChange event gt this setState text event target value gt this state text In this example the component s state object contains a single property text which is used to store the current text entered by the user The value prop of the input element is set to this state text so that the input element displays the current value of the text property The onChange prop of the input element is set to a function that calls this setState with the new value of the text Another way to store state in a React application is to use a state management library such as Redux or MobX These libraries provide a centralized store that can be used to store the entire state of an application and provide a set of tools for updating the state in response to user interactions or other events For example the following code shows how to use the createStore function from the Redux library to create a store that contains the entire state of an application import createStore from redux const store createStore state text action gt switch action type case UPDATE TEXT return state text action text default return state In this example the createStore function is called with a single argument a reducer function The reducer function is a pure function that takes the current state and an action and returns the new state The createStore function returns an object that has a number of methods for interacting with the state such as getState dispatch and subscribe One of the main benefits of using a state management library is that it makes it easier to manage the state of a large and complex application By centralizing the state in a single store it becomes easier to understand how the different parts of the application are related and how they interact with each other It also makes it easier to debug and test the application as all the state is in one place It s also worth noting that state management libraries such as Redux and MobX provide a way to manage the state of an application in a way that is more predictable and maintainable than directly updating the state in a component s state object This is because state management libraries enforce a unidirectional data flow which means that the state can only be updated in a specific way This helps prevent bugs and makes it easier to understand how the application works When it comes to implementing state management in a React application there is no one right way to do it It depends on the complexity of your application the needs of your users and your personal preferences If your application is small and simple then it may be sufficient to store state directly in a component s state object However if your application is large and complex then using a state management library may be a better option In conclusion understanding and implementing state management in a React application is an important aspect of building robust and maintainable applications It allows you to keep track of the current state of your application and update it in response to user interactions or other events While it s possible to store state directly in a component s state object using a state management library such as Redux or MobX can make it easier to manage the state of a large and complex application Remember that the key is to find the best solution for your specific use case and to make sure that it scales as your application grows |
2023-01-16 13:02:30 |
Apple |
AppleInsider - Frontpage News |
Apple's India iPhone plan will hit China manufacturers hard |
https://appleinsider.com/articles/23/01/16/apples-india-iphone-plan-will-hit-china-manufacturers-hard?utm_medium=rss
|
Apple x s India iPhone plan will hit China manufacturers hardApple s radical Indian iPhone production expansion will take years to hit of global demand but component suppliers in China are already seeing the impact Mumbai IndiaPrevious claims of Apple looking at giant India expansion for its manufacturing and specific iPhone trial production reports are having an effect in China Read more |
2023-01-16 13:46:04 |
Apple |
AppleInsider - Frontpage News |
iPhone 14 Pro finally reaches supply-demand parity |
https://appleinsider.com/articles/23/01/16/iphone-14-pro-finally-reaches-supply-demand-parity?utm_medium=rss
|
iPhone Pro finally reaches supply demand parityDelivery dates for the iPhone Pro lineup have fallen to less than a week suggesting that Apple has finally caught up with demand after a challenging quarter iPhone availability normalizes around the globeThe zero Covid policy in China led to extended lockdowns followed by employee riots in a Zhengzhou Foxconn plant It took weeks to get the plant back to normal operations and iPhone Pro supply is only just showing signs of catching up Read more |
2023-01-16 13:36:52 |
Apple |
AppleInsider - Frontpage News |
Apple honors Dr. Martin Luther King Jr. with free book, homepage tribute |
https://appleinsider.com/articles/23/01/16/apple-honors-dr-martin-luther-king-jr-with-free-book-homepage-tribute?utm_medium=rss
|
Apple honors Dr Martin Luther King Jr with free book homepage tributeApple has turned over its whole homepage to honor Dr Martin Luther King Jr and is also providing a free copy of Stride Toward Freedom For the past eight years since Apple has switched its homepage to an single image of Dr King This year alongside the inspirational quote Apple Books is offering a free copy of Stride Toward Freedom The book by Dr King is an account of the Montgomery bus boycott and concerns the conditions experienced by African Americans in Alabama at the time Read more |
2023-01-16 13:18:56 |
海外TECH |
CodeProject Latest Articles |
Angular Control to graphic representation for Processes and Events |
https://www.codeproject.com/Tips/5350642/Angular-Control-to-graphic-representation-for-Proc
|
displays |
2023-01-16 13:12:00 |
海外科学 |
NYT > Science |
A Fake Death in Romancelandia |
https://www.nytimes.com/2023/01/16/health/fake-death-romance-novelist-meachen.html
|
addiction |
2023-01-16 13:19:43 |
ニュース |
BBC News - Home |
Met Police officer David Carrick admits to being serial rapist |
https://www.bbc.co.uk/news/uk-england-beds-bucks-herts-64289461?at_medium=RSS&at_campaign=KARANGA
|
multiple |
2023-01-16 13:13:45 |
ニュース |
BBC News - Home |
Italy's most-wanted mafia boss Matteo Messina Denaro arrested in Sicily |
https://www.bbc.co.uk/news/world-europe-64288928?at_medium=RSS&at_campaign=KARANGA
|
mafia |
2023-01-16 13:07:45 |
ニュース |
BBC News - Home |
Transgender people lose NHS waiting times High Court case |
https://www.bbc.co.uk/news/uk-64288386?at_medium=RSS&at_campaign=KARANGA
|
people |
2023-01-16 13:54:25 |
ニュース |
BBC News - Home |
CCTV shows people fleeing drive-by shooting outside church |
https://www.bbc.co.uk/news/uk-64293045?at_medium=RSS&at_campaign=KARANGA
|
churcha |
2023-01-16 13:13:27 |
コメント
コメントを投稿