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
############################################################################ | |
# Installing nodejs, npm, and all their pals on an Ubuntu 12.x server | |
############################################################################ | |
# Make sure we're getting the newest packages. | |
sudo apt-get update | |
# If this is a local image, you may need sshd set up. | |
sudo apt-get install openssh-server openssh-client |
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
function DocumentCacheService() { | |
var self = this; | |
EventService.on( 'document::translated', function( data ) { | |
/////////// This is the line you have to add. //////////////// | |
console.log( data ); | |
/////////// That's all. //////////////// | |
self.addDocument( data ); | |
}); |
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
async.map( ['A', 'B', 'C' ], | |
function( item, cb ) { | |
console.log( item ); | |
cb( null, '' + item + item ); | |
}, | |
function( error, results ) { | |
console.log( 'results: ' + require( 'util' ).inspect( results ) ); | |
}); | |
async.map( ['A', 'B', 'C' ], |
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
crispin:node cmlacy$ git remote show | |
Hubert | |
engine-deployed | |
engine-developer | |
faiz | |
origin | |
patrick | |
crispin:node cmlacy$ git checkout master | |
Switched to branch 'master' | |
crispin:node cmlacy$ git checkout -b Preview-2-9-2013 |
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
# To see the list of forwarding routes: | |
sudo iptables -L -t nat | |
# To add a couple new routes: | |
ubuntu@ip-10-64-50-6:~$ sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 1336 | |
ubuntu@ip-10-64-50-6:~$ sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 1337 | |
# To delete a route (note that the rule number starts at 1!) | |
ubuntu@ip-10-64-50-6:~$ sudo iptables -t nat -D PREROUTING 3 |
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/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later version. |
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
#mongos config file | |
#config servers | |
configdb=ip-10-253-56-49.us-west-2.compute.internal:27017,ip-10-250-61-137.us-west-2.compute.internal:27017,ip-10-245-97-8.us-west-2.compute.internal:27017 | |
#where to log | |
logpath=/var/log/mongodb/mongos.log | |
#log overwritten or appended to | |
logappend=true |
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
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
var lineCounts = {}; | |
var previousFragment = ''; | |
process.stdin.on('data', function (chunk) { | |
var lines = chunk.split( '\n' ); | |
lines[0] = previousFragment + lines[0]; | |
previousFragment = lines.pop(); | |
lines.forEach( function( line ) { |
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
/* | |
* Full example here: http://jsfiddle.net/jboesch26/3SKsL/1/ | |
*/ | |
$.fn.outerHTML = function(){ | |
// IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning | |
return (!this.length) ? this : (this[0].outerHTML || ( | |
function(el){ | |
var div = document.createElement('div'); |
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
# Create a new Ubuntu 13 instance. | |
# Get the tools and things as specified in https://gist.github.com/curtislacy/3905950/ | |
sudo fdisk -l | |
sudo mkfs -t ext3 /dev/xvde1 | |
sudo mkdir /var/lib/blockchain | |
sudo vi /etc/fstab | |
# Add: | |
# /dev/xvde1 /var/lib/blockchain ext3 defaults,noatime 0 2 | |
sudo mount -a |
OlderNewer