Skip to content

Instantly share code, notes, and snippets.

@danielsmith-eu
danielsmith-eu / gist:52dd0afade4cbd635a70
Created October 23, 2014 13:35
Who's that Meat? - for meatspace 2
function setMeatColor() {
var nodes = document.getElementById("messages").childNodes;
for (var i = 0; i < nodes.length; ++i) {
var node = nodes[i];
var fp = node.attributes['data-fp'].value;
node.style.borderLeft = "6px solid #" + fp.substr(0,6);
}
setTimeout(setMeatColor, 100);
}
setMeatColor();
@gggritso
gggritso / console.lol.js
Created October 10, 2014 03:33
console.lol
console.lol = function() {
var harray = [], harrumpf = Math.floor( Math.random() * 10 + 2 );
while ( harrumpf-- ) harray.push( 'ha' );
console.log( harray.join( '' ) + '!' );
}
@thegoleffect
thegoleffect / simple-rot13-stream.js
Last active August 29, 2015 14:02
Simple ROT13 Stream
var Stream = require('stream');
var Util = require('util');
/*
To Use:
var rot13 = new ROT13Stream();
streamOne.pipe(rot13).pipe(process.stdout); // takes readstream streamOne, modifies with rot13, pipes into stdout
*/
function (childName) {
var method;
return function fn() {
if (!method) {
for (var key in this) {
if (this[key] === fn) {
method = key;
break;
}
}
function(fn, thisArg) {
var newArray = [];
for (var i = 0, l = this.length; i < l; i++) {
newArray.push(fn.call(thisArg, this[i], i, this));
}
return newArray;
};

Web app development entails:

  • interacting with data
  • syncing ui and data
  • responding to user interaction (dom events)
  • user flow (navigating screens)
  • url (de)serialization
@brittanydionigi
brittanydionigi / shifts.js
Created March 27, 2014 21:12
making people do my work for me
/* Some boys are playing a hockey game and they each play a certain number of shifts. */
/* For simplicity, we'll say there are 15 different shifts in a game. */
[
{
"player": "Joe",
"shifts": [
{ "shift_start": 3, "shift_end": 5 }, // Joe started playing at shift #3, and stopped after shift #5
{ "shift_start": 7, "shift_end": 11 }
]
alias wow='git status'
alias such='git'
alias very='git'
wow
such commit
very push
/*!
* jQuery JavaScript Library v2.1.1pre
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license