Amazon Simple Notification Service (Amazon SNS) is a managed service that provides message delivery from publishers to subscribers (also known as producers and consumers). Publishers communicate asynchronously with subscribers by sending messages to a topic, which is a logical access point and communication channel. Clients can subscribe to the SNS topic and receive published messages using a supported endpoint …
Heroku Add-on CronToGo
We are using cronjob for job on most project. Normally we can set the cronjob on servers. But heroku is not providing the functionality by default. For that, we can install crontogo add-on ( not free ) By the crontogo, we can set cronjobs simply please check https://devcenter.heroku.com/articles/crontogo
postman pre-script
Most developers are using post-man to check REST apis. Post-man is providing a lot of functionality. Pre-script is also one of them. We can define and update variables before send the request. it is useable to create a signature for REST api. https://learning.postman.com/docs/writing-scripts/pre-request-scripts/ You can check the guide. The script is based on javascript. So, …
How to send a bunch email via sendgrid?
Normally we are sending the email on sendgrid one by one. But specifically, we can meet some case to send a bunch email. In the case, we can use the personalization of sendgrid. The personalization has 1000 limitations. so if you want to send more emails than 1000, you need to split the request. Please …
How to check dependencies which are not used in project.
depcheck is a npm packange which checks what dependencies are not used in the project. https://www.npmjs.com/package/depcheck As you can see on the link, it is very easy to use. Mainly it is used to clear package.json file.
How to use private package on github action
Github provides github action for CI/CD. For the CI, we could meet some cases to use private packages. In this case, npm run install will have permission problem. So, we need to set ssh agent. – name: Set ssh agent uses: webfactory/ssh-agent@v0.4.1 with: ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY }} Then it will work for a private repository. …
How to return large json file on laravel?
We could have some cases which should fetch large json for DB records. On laravel, we can simple following as: response->json(User::get()….) But if the records are large, it will have a lot of ram on server. Also if there are a lot of requests, it will be more problems. So, we can solve following as: …
google oauth2 – googleapis
We can use googleapis npm to implement google oauth2 functionality.Main thing is to create new one by refresh token when access token is expired. Get authorization code from client. Get refresh token from authorization code. Add following code to generate access token automatically when it is expired oauth2Client.on(‘tokens’, (tokens) => { if (tokens.refresh_token) { // store the refresh_token in my database! console.log(tokens.refresh_token); } console.log(tokens.access_token);});