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 | |
# USAGE: ./watchrun.sh COMMAND | |
# New credit to: http://exyr.org/2011/inotify-run/ | |
# this script will wait for changes in the current directory tree, and when one occurs, it will run COMMAND, then resume waiting | |
# requires inotify-tools: | |
# sudo apt-get install inotify-tools | |
# or: |
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
/** | |
* Wrap your function such that it will be executed every N times it's called. | |
* This is useful in a long-running loop such as the main loop in a game, where | |
* you want to execute certain functions every 10 frames, or similar, but don't | |
* want to manage a dozen separate "timers". | |
* | |
* @param {Function} f the function to wrap | |
* @param {Number} n execute the function every `n` times | |
*/ | |
function nth(f, n) { |
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
// ==UserScript== | |
// @name Godzilla Rampage | |
// @namespace godzilla.substitution.fun | |
// @description Replaces 'God' with 'Godzilla' | |
// @version 1.0.0 | |
// @grant none | |
// @include http://* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// ==/UserScript== |
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
// question: why cant Dhoni introduce himself? | |
// please fix it. Make Dhoni introduce himself! | |
var Man = function( name ) { | |
this.name = name | |
} | |
Man.prototype.introduce = function() { | |
console.log( this.name ) | |
} |
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
|------|------------|---------------------------------------------------------| | |
| Code | Meaning | Description | | |
|------|------------|---------------------------------------------------------| | |
| ? | what? | It's not a file in CVS. CVS knows nothing about this | | |
| | | file | | |
|------|------------|---------------------------------------------------------| | |
| A | Added | This is a file you just added to CVS but not yet | | |
| | | committed. You have to commit it before others can see | | |
| | | it. | | |
|------|------------|---------------------------------------------------------| |
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
color_0 = cccc cccc cccc | |
color_1 = 1c1c 1c1c 1b1b | |
color_2 = 6c6c 6c6c 9c9c | |
color_3 = 8888 b0b0 9090 | |
color_4 = bcbc 6c6c 4c4c | |
color_5 = e3e3 7171 7070 | |
color_6 = bcbc 6c6c 9c9c | |
color_7 = dfdf afaf 8f8f | |
color_8 = f8f8 f8f8 9393 | |
color_9 = 9e9e cece 9e9e |
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
// This works | |
/** | |
* What is love? | |
* | |
* @name Bananana | |
* @constructor | |
*/ | |
function Bananana () { |
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 () { | |
var system = require('system'); | |
var casper = require('casper').create({ | |
clientScripts : [ 'jquery.min.js' ], | |
waitTimeout : 30000, // ms | |
logLevel : 'debug', // info, debug, warning, or error | |
verbose : system.args.indexOf('-v') >= 0 | |
}); |
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
# map the cp-local user hostnames to the remote environment hostnames | |
map $http_host $upstream_host { | |
~^dev-.*\.domain\.com$ real.domain.com; | |
} | |
# Listen on port 80, but redirect to https/443 | |
server { | |
listen 80; | |
server_name ~^(dev|qa|stage|prod).*\.domain\.com$; |
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
After installing meteor, I ran these commands | |
meteor create testapp | |
cd testapp | |
meteor | |
Then I modified the is_server block of testapp.js like so: | |
if (Meteor.is_server) { | |
Meteor.startup(function () { |