Skip to content

Instantly share code, notes, and snippets.

View shivshankar3578's full-sized avatar
🏠
Working from home

shivshankar3578

🏠
Working from home
View GitHub Profile
@shivshankar3578
shivshankar3578 / foo.js
Created July 2, 2018 10:23 — forked from OliverJAsh/foo.js
Async iterators with map, skipWhile, and takeUntil
class FunctifiedAsync {
constructor(iterable) {
this.iterable = iterable;
}
async *[Symbol.asyncIterator]() {
for await (const value of this.iterable) {
yield value;
}
}
#!/usr/bin/env bash
function check_status_code {
local name=$1
local status=$2
if [ $status -ne 0 ]; then
echo $name failed with status code $status
exit $status
fi
echo Success: $name with code $status
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@shivshankar3578
shivshankar3578 / aws-sns-example.js
Created July 21, 2017 11:50 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();