Skip to content

Instantly share code, notes, and snippets.

View samshull's full-sized avatar
🎯
Focusing

Sam Shull samshull

🎯
Focusing
View GitHub Profile
From b26787bc203f0318161d014baea93894ca881244 Mon Sep 17 00:00:00 2001
From: Sam Shull <brickysam26@gmail.com>
Date: Tue, 20 Jul 2010 14:09:09 -0400
Subject: [PATCH] Add parenthesis to NODE_VERSION_AT_LEAST
---
src/node_version.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/node_version.h b/src/node_version.h
From ba387e2b80e4ea02652d66c2d0e689d172907719 Mon Sep 17 00:00:00 2001
From: Samuel Shull <brickysam26@samuel-shulls-computer.local>
Date: Wed, 4 Aug 2010 01:25:17 -0400
Subject: [PATCH] Add node_version.h to install
---
wscript | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/wscript b/wscript
<?php
$_Retreived = array(
"website1.com" => array(
array('60" BRAVIA LX900 Series 3D HDTV', 'website1.com', 5299.99),
array('52" BRAVIA LX900 Series 3D HDTV', 'website1.com', 4499.99),
array('46" BRAVIA LX900 Series 3D HDTV', 'website1.com', 3699.99),
array('40" BRAVIA LX900 Series 3D HDTV', 'website1.com', 2999.99)
),
"website2.com" => array(
array('Sony 3D 60" LX900 HDTV BRAVIA', 'website2.com', 5400.99),
function encode_users(data) {
var string = '';
$.each(data, function(index, info) {
string += '&users[' + index + '][onlineid]=' + encodeURIComponent(info.onlineid);
string += '&users[' + index + '][comment]=' + encodeURIComponent(info.comment);
});
return string;
}
$.ajax({
@samshull
samshull / proxy_memleak.js
Created June 24, 2011 18:37 — forked from richardms/proxy_memleak.js
Possible memory leak in node-proxy
// Run with:
// node --trace-gc proxy_memleak.js
var Proxy = require("/Users/brickysam26/Projects/node-proxy/lib/node-proxy"),
// fs = require('fs'),
util = require("util") ;
var count = 100000 ;
@samshull
samshull / stack-trace.js
Created July 18, 2011 02:13
Cross Browser javascript stack trace
function printStackTrace() {
var callstack = [];
var isCallstackPopulated = false;
try {
i.dont.exist+=0; //doesn't exist- that's the point
} catch(e) {
if (e.stack) { //Firefox
var lines = e.stack.split('\n');
for (var i=0, len=lines.length; i<len; i++) {
if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
@samshull
samshull / gist:1139560
Created August 11, 2011 12:49
better_world
def better_world
people_of_the_world.reject! do |person|
person.is_lawyer? || person.is_politician?
end
end
if (!('filter' in Array.prototype)) {
// conforms with the ECMA standard
Array.prototype.filter = function filter(fn, thisArg) {
var index = 0, length = this.length, value, returnValue = [], that = Object(this);
for (; index < length; ++index) {
if (index in that) {
value = that[index];
if (fn.call(thisArg, value, index, that)) {
returnValue.push(value);
}
@samshull
samshull / gist:1169764
Created August 25, 2011 01:36 — forked from tjh/gist:1051092
Watchr script for Cucumber, Rspec, and Evergreen
system('clear')
ENV["WATCHR"] = "1"
$spec_cmd = "rspec --colour --format nested -d"
$evergreen_cmd = "evergreen run ."
GROWL = `which growlnotify`.chomp
if GROWL.empty?
puts "Missing growlnotify command for growl notifications"
# Ensures that the default shell is the same as the value of the $SHELL env variable
shell -$SHELL
# Define the time that all windows monitored for silence should
# wait before displaying a message. Default 30 seconds.
silencewait 15
# Automatically detach on hangup.
autodetach on