Skip to content

Instantly share code, notes, and snippets.

View jeffturcotte's full-sized avatar

Jeff Turcotte jeffturcotte

View GitHub Profile
@jeffturcotte
jeffturcotte / gist:6501188
Last active December 22, 2015 16:39
Cycle 2 BG lookahead plugin
/*! Cycle2 lookahead plugin for backgrounds
* Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL
* @author Jeff Turcotte <[email protected]>
*/
(function($) {
"use strict";
$(document).on( 'cycle-initialized', function(e, opts) {
var key = 'cycle-look-ahead';
<?php
/**
* A class to help with adding build methods
* to your fActiveRecord models.
*
* @author Jeff Turcotte <[email protected]>
* @license MIT
* @version 1.0
*
* Usage:
@jeffturcotte
jeffturcotte / .tmux.conf
Last active December 10, 2015 23:58
tmux conf
# osx copy/paste
set-option -g default-command "reattach-to-user-namespace -l bash"
# 256 colors
set -g default-terminal "xterm-256color"
# history
set -g history-limit 20000
# set vi keys
@jeffturcotte
jeffturcotte / gist:4512498
Last active December 10, 2015 23:49
fActiveRecord Builder plugin example
<?php
$builder = new Builder('Page', array(
'name' => 'asc'
));
$builder->register('buildActive', function(&$where) {
$where['status='] = 'active';
});
$builder->extend('buildActive', 'buildActivePublished', function(&$where) {
@jeffturcotte
jeffturcotte / isItScrollableWithoutVisibleScrollbars.js
Created July 22, 2011 19:02 — forked from jlbruno/isItScrollableWithoutVisibleScrollbars.js
a function to check if a certain element is scrollable, but is NOT showing scrollbars. Useful to use as a test for when you might want to implement another scrolling solution, such as iScroll for iPad.
var isItScrollableWithoutVisibleScrollbars = function(el) {
return (el && (el.scrollHeight > el.offsetHeight) && !(el.offsetWidth > el.scrollWidth));
};
import sublime, sublime_plugin, subprocess
class DocsendCommand(sublime_plugin.TextCommand):
def run(self, edit):
script = """
on run
ignoring application responses
tell application "Transmit"
open POSIX file "%s"
end tell
var Module = (function(){
this.myMethod = function(x) {
return x
};
return this;
})();