Skip to content

Instantly share code, notes, and snippets.

View pthrasher's full-sized avatar

Philip Thrasher pthrasher

View GitHub Profile
@pthrasher
pthrasher / get_asset_url.js
Created July 27, 2015 14:14
Example of babel plugin to aid rails sprocket tie-in.
var fs = require('fs');
var path = require('path');
var md5itCfg = require('../grunt/config/cl_md5it');
module.exports = function(babel) {
var t = babel.types;
var md5sFile = md5itCfg.options.manifestFile;
var md5s, cache = {};
require 'json'
module Sass::Script::Functions
def get_md5s
md5sfile = File.join Dir.pwd, 'tmp/browser/cache/md5.json'
return JSON.parse(File.read(md5sfile))
end
@pthrasher
pthrasher / sshuttle.rb
Created February 3, 2015 15:59
sshuttle formula for 10.10 support
require 'formula'
class Sshuttle < Formula
homepage 'https://github.com/jagheterfredrik/sshuttle'
url 'https://github.com/jagheterfredrik/sshuttle/archive/master.zip'
sha1 '5fbc3f7d949a419266d93aa09dc60bc03d8c8488'
head 'https://github.com/jagheterfredrik/sshuttle.git'
def install
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"