Skip to content

Instantly share code, notes, and snippets.

View pthrasher's full-sized avatar

Philip Thrasher pthrasher

View GitHub Profile
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
syntax on
set nocompatible
set modelines=0
set tabstop=4
set shiftwidth=4
// jQuery Plugin Boilerplate
// A boilerplate for jumpstarting jQuery plugins development
// version 1.1, May 14th, 2011
// by Stefan Gabos
// remember to change every instance of "pluginName" to the name of your plugin!
(function($) {
// here we go!
$.pluginName = function(element, options) {
<script type="text/javascript" charset="utf-8">
$(function(){
$(".post-194.page.type-page.status-publish.hentry br").remove()
});
</script>
@pthrasher
pthrasher / countdown.html
Created September 12, 2011 18:24
the countdown script for victorychurch.ws
<script language="javascript" type="text/javascript">
function counter(el){
var self = $(el),
_el = el;
self.countDown({
targetDate: {
'day': <?=$config['targetDate']['day']?>,
'month': <?=$config['targetDate']['month']?>,
'year': <?=$config['targetDate']['year']?>,
'hour': <?=$config['targetDate']['hour']?>,
@pthrasher
pthrasher / next_sunday_counter.html
Created September 12, 2011 19:19
figures out the date for next sunday, and then runs the counter off of that.
<script language="javascript" type="text/javascript">
function nextSunday(){
var d = new Date(),
day = 86400000;
var dayMult = 0,
currDay = d.getDay();
if (currDay < 1) {
// it's sunday
hiro:~ pthrasher$ curl -L https://github.com/atmos/cinderella/raw/master/bootstrap.sh -o - | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1233 100 1233 0 0 1113 0 0:00:01 0:00:01 --:--:-- 1113
Ensuring we have the latest version of cinderella installed
A first time install takes about 45 minutes on a modern machine
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/json-1.6.0.gemspec]: invalid date format in specification: "2011-09-12 00:00:00.000000000Z"
You need to upgrade rubygems to 1.7.2
Cinderella installed successfully
[Fri, 16 Sep 2011 16:53:33 -0400] INFO: *** Chef 0.10.4 ***
hiro:~ pthrasher$ sudo gem update --system
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.8.10
Updating RubyGems to 1.8.10
Installing RubyGems 1.8.10
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/json-1.6.0.gemspec]: invalid date format in specification: "2011-09-12 00:00:00.000000000Z"
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/json-1.6.0.gemspec]: invalid date format in specification: "2011-09-12 00:00:00.000000000Z"
RubyGems 1.8.10 installed
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/json-1.6.0.gemspec]: invalid date format in specification: "2011-09-12 00:00:00.000000000Z"
Chef::Exceptions::Exec: homebrew[git] (homebrew::default line 64) had an error: /usr/bin/env HOMEBREW_TEMP=/Users/pthrasher/Developer/tmp /Users/pthrasher/Developer/bin/brew install git returned 1, expected 0
/Library/Ruby/Gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/command.rb:185:in `handle_command_failures'
/Library/Ruby/Gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/command.rb:132:in `run_command'
/Library/Ruby/Gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/command.rb:200:in `run_command_with_systems_locale'
/Users/pthrasher/.cinderella/cookbooks/homebrew/providers/homebrew.rb:33:in `run_brew_command'
/Users/pthrasher/.cinderella/cookbooks/homebrew/providers/homebrew.rb:23:in `install_package'
/Library/Ruby/Gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/package.rb:60:in `action_install'
/Library/Ruby/Gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `send'
/Library/Ruby/Gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `run_action'
/Library/Ruby/Gems/1.8/gems/chef-0.10.4/bin
hiro:~ pthrasher$ curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | bash
Downloading virtualenv-burrito command
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7683 100 7683 0 0 27610 0 --:--:-- --:--:-- --:--:-- 30979
Running: virtualenv-burrito upgrade firstrun
+ distribute will upgrade (None -> 0.6.21)
+ virtualenv will upgrade (None -> 1.6.4)
+ virtualenvwrapper will upgrade (None -> 2.8)
@pthrasher
pthrasher / gist:1268469
Created October 6, 2011 19:55
JavaScript scope oddities
/*
* This is just a short demo of some of the scoping
* oddities in JS that you should watch out for.
*/
var x = 1;
console.log(x);
function foo() {
console.log(x);