export AWS_DEFAULT_REGION=ap-northeast-1
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \
awk '{print $2}' | grep -v ^$ | while read x; do echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var https = require('https'); | |
| var util = require('util'); | |
| exports.handler = function (event, context) { | |
| console.log(JSON.stringify(event, null, 2)); | |
| console.log('From SNS:', event.Records[0].Sns.Message); | |
| var severity = "good"; | |
| var message = event.Records[0].Sns.Message; | |
| var messageJSON = JSON.parse(message); |
First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.
- User interaction involved
- Authorization code
This grant type is most appropriate for server-side web applications. After the resource owner has authorized access to their data, they are redirected back to the web application with an authorization code as a query parameter in the URL. This code must be exchanged for an access token by the client application. This exchange is done server-to-server and requires both the client_id and cli ent_secret, preventing even the resource owner from obtaining the access token. This grant type also allows for long-lived access to an API by using refresh tokens. - Implicit grant for browser-based client-side applications
The implicit grant is the most simplistic of all flows, and is optimized for clientside web applications running in a browser. The resource owner grants access to the application, and a new access token is immediately minted and passed back to the application using a #hash fragment in the URL. The application can immediately e
- Authorization code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var AWS = require('aws-sdk'); | |
| var cloudwatch = new AWS.CloudWatch({ region: 'us-east-1'}); | |
| exports.handler = function (event, context) { | |
| var ElasticSearchHost = 'elasticsearch.example:9200'; | |
| var Environment = 'int'; | |
| var EndTime = new Date; | |
| var StartTime = new Date(EndTime - 15*60*1000); | |
| var Metrics = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| URLs: | |
| http://localhost:3000/arrive?foo=bar&utm_source=smart-redir | |
| */ | |
| var redirect = require('redirect-with-params'); | |
| var express = require('express'); | |
| var app = express(); | |
| app.use(redirect({ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Clone the repo | |
| git clone --depth=1 git://someserver/somerepo dirformynewrepo | |
| // Remove the .git directory | |
| rm -rf !$/.git |
NewerOlder