View script-boilerplate.js
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 Async = require('async'); | |
exports.script = function () { | |
var options = internals.parseOptions(); | |
var context = { | |
options: options, | |
state: {}, |
View dynamodb-doc-test.js
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 Aws = require('aws-sdk'); | |
var DynamoClient = require('dynamodb-doc').DynamoDB; | |
// This script uses the Shared Credentials File. See reference below for more: | |
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html | |
Aws.config.update({ region: 'us-east-1' }); | |
var internals = {}; |
View fetch-s3-folder.js
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
// fetch-s3-folder.js | |
// | |
// usage: node fetch-s3-folder.js bucketName folderPath | |
// ex: node fetcb-s3-folder.js our-bucket /my-folder/cool-subfolder | |
// | |
// to install dependencies, run following in same folder as this script: | |
// mkdir node_modules && npm install async knox mkdirp | |
// | |
// also expects a `config.json` in same directory with AWS credentials |
View serialport-sniff.js
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 SerialPort = require('serialport').SerialPort; | |
var util = require('util'); | |
if (!process.argv[2]) { | |
console.error('specify device'); | |
process.exit(1); | |
} | |
var PATH = process.argv[2]; | |
var DATA = {}; |
View check-git
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
#!/bin/bash | |
git pull && \ | |
git remote prune origin && \ | |
git status && \ | |
git stash list && \ | |
git branch -a |
View plain-js-date-math.js
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 thirtyDays = 1000 * 60 * 60 * 24 * 30; | |
var today = new Number(new Date()); | |
new Date(today + thirtyDays); |
View pretty-json
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
#!/usr/bin/env node | |
var concat = require('concat-stream'); | |
process.stdin.pipe(concat(function (data) { | |
var json = JSON.parse(data); | |
var str = JSON.stringify(json, null, 2); |
View node-irc-bot.js
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
// quick sketch based on http://davidwalsh.name/nodejs-irc | |
var Irc = require('irc') | |
var settings = { | |
channels: [ | |
'#node.js' | |
], | |
server: 'irc.freenode.net', | |
botName: 'idlebot' |
View get-spumko-makefiles.js
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
// node get-spumko-makefiles.js && vim *.Makefile | |
var Async = require('async') | |
var Fs = require('fs') | |
var Request = require('request') | |
Request({ | |
uri: 'https://api.github.com/orgs/spumko/repos', | |
headers: { | |
'User-Agent': ' ' |
View index.js
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('logging:') | |
console.log(asdf) | |
console.log(foo) | |
function asdf () { | |
// noop | |
} | |
var foo = function () { | |
// asdf |
NewerOlder