This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
'use strict'; | |
console.log('Loading function'); | |
var AWS = require("aws-sdk"); | |
exports.handler = (event, context, callback) => { | |
console.log('Received event:', JSON.stringify(event, null, 2)); | |
event.Records.forEach((record) => { | |
console.log(record.eventID); | |
console.log(record.eventName); |
This file contains 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
console.log('Loading function'); | |
var AWS = require("aws-sdk"); | |
var docClient = new AWS.DynamoDB.DocumentClient(); | |
exports.handler = (event, context, callback) => { | |
console.log('Received event:', JSON.stringify(event, null, 2)); | |
event.Records.forEach((record) => { | |
console.log('Stream record: ', JSON.stringify(record, null, 2)); | |
console.log(record.eventID); |
This file contains 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
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB(); | |
var iotData = new AWS.IotData({endpoint: 'something.iot.ap-southeast-2.amazonaws.com'}); | |
//make sure your replace your_AWS_endpoint_you_copied_earlier with the value you copied just before | |
exports.handler = function(event, context) { | |
console.log("Request received:\n", JSON.stringify(event)); | |
console.log("Context received:\n", JSON.stringify(context)); |
This file contains 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
console.log('Loading event'); | |
var elasticsearch = require('elasticsearch'); | |
exports.handler = function(event, context) { | |
console.log("Request received:\n", JSON.stringify(event)); | |
console.log("Context received:\n", JSON.stringify(context)); | |
var tableName = event.device; | |
var time = event.time; | |
var Temperature = event.data.Temperature; |
This file contains 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
# https://discussions.apple.com/thread/6987059?start=0&tstart=0 | |
sudo chmod -x /System/Library/CoreServices/rcd.app/Contents/MacOS/rcd && sudo killall -9 rcd |
This file contains 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 arr1 = ['a', 'b', 'c']; | |
console.log(arr1.length); | |
var arr2 = ['d', 'e', 'f']; | |
console.log(arr2.length); | |
var arr3 = ['g', 'h', 'i']; | |
console.log(arr3.length); | |
var nested = [arr1, arr2, arr3]; | |
console.log('nested=' + nested); | |
console.log(nested.length); | |
var flattened = [].concat.apply([], nested); |
This file contains 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 ts = Math.round((new Date()).getTime() / 1000); |
This file contains 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
n = 46:1:200; | |
plot(n, log(n.^2)); |
This file contains 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
cp .env.docker_exmaple .env | |
npm install | |
yarn | |
docker-compose up | |
mongorestore -d express-mongoose-es6-rest-api-development sed-test-db/ |
OlderNewer