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
| #!/bin/bash | |
| INSTRUCTIONS=""" | |
| USAGE | |
| $ compile -o filename [--clean] [--backup] [--archive] [--help] cfilenames | |
| WHERE | |
| filename: name of the outputed executable | |
| cfilenames: list of c source files to be compiled together | |
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
| modules = [ 'then-redis', 'http', 'express', 'socket.io' ] | |
| [ redis, http, express, io ] = (require(mod) for mod in modules) | |
| # redis | |
| db = redis.createClient() | |
| db.setnx('users:count', 0) | |
| # server |
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 q = new PriorityQueue; | |
| var nums = [ 1, 4, 6, 3, 9 ]; | |
| nums.forEach(q.add, q); | |
| nums.forEach(q.add, q); | |
| var outs = []; | |
| while (q.length) outs.push(q.hpop()); | |
| console.log(outs); | |
| // [ 9, 9, 6, 6, 4, 4, 3, 3, 1, 1 ] |
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 queue = []; | |
| var audio = new Audio(); | |
| audio.controls = true; | |
| audio.autoplay = true; | |
| audio.addEventListener('ended', function (ev) { | |
| console.log('next song'); | |
| playNext(); | |
| }); |
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 username package | |
| function clone { | |
| if [! -z $2] | |
| then repo="$1/$2" | |
| else repo="$1" | |
| fi | |
| git clone "[email protected]:$repo.git" && cd $(basename $repo) | |
| } |
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
| { | |
| "name": "markdown-editor", | |
| "private": true, | |
| "dependencies": { | |
| "bootstrap": "~3.2.0", | |
| "angular": "~1.2.18", | |
| "showdown": "~0.3.1" | |
| } | |
| } |
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 waterfall = require('async-waterfall') | |
| var flatten = require('lodash.flatten') | |
| module.exports = compose | |
| function compose () { | |
| var middlewares = flatten(arguments) | |
| function composed (req, res, next) { | |
| var callbacks = middlewares.map(function (middleware) { |
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 path = require('path') | |
| var dirname = path.dirname(require.main.filename) | |
| var root = dirname.split('/node_modules/')[0] | |
| module.exports = root |
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
| { | |
| "private": true, | |
| "name": "helloworld", | |
| "version": "0.0.0", | |
| "dependencies": { | |
| "requirejs": "~2.1.9" | |
| } | |
| } |
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
| #!/usr/bin/env ruby | |
| # put in scripts folder, and make executable | |
| # $ chmod +x scripts/mongo | |
| require 'yaml' | |
| HELP = ''' |
OlderNewer