This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ShitCan | |
require 'memcached' | |
def self.load(con_path='localhost:11211') | |
@cache = Memcached.new(con_path) | |
end | |
def self.cache | |
if @cache | |
return @cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your Controller | |
def some_controller_action | |
ShitCan.skip_if_exists("#{params[:id]}_save_me") do | |
@blah = User.find_by_login(params[:id]) | |
@items = Ass.timeline(@dj.id.to_s) | |
@items.some_cpu_heavy_command | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module API | |
def self.has_access?(token) | |
network = const_get token.for | |
network.has_access? token.key, token.secret | |
end | |
def display_files(files, token) | |
network = const_get token.for | |
network.display_files files, token.key, token.secret | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PP.Rotator = function(){ | |
_rotator = { | |
_opts: { | |
interval: 5, | |
rotate: function(){} | |
}, | |
_timer: null, | |
start: function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Tyler Love | |
email = github@tylr.org | |
[core] | |
editor = mate -w | |
excludesfile = /Users/tylr/.gitignore | |
[color] | |
diff = auto | |
branch = auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DV.Slideshow = (function() { | |
var _o = {}; | |
var _enabled = null; | |
var _current = null; | |
var _current_img = null; | |
var _slides = []; | |
var _loaded = []; | |
function init(opts) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function offset_current_by(offset) { | |
return _slides[offset_index(offset)]; | |
}; | |
function offset_index(offset) { | |
var last = _slides.length - 1; | |
var idx = index_of(_current) + offset; | |
idx = (idx >= 0) ? idx : last + idx; | |
idx = (idx <= last) ? idx : idx - last; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DV.Slideshow = (function() { | |
var _o = {}; | |
var _enabled = null; | |
var _current = null; | |
var _current_img = null; | |
var _slides = []; | |
var _loaded = []; | |
function init(opts) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DV.Slideshow = (function() { | |
var _o = {}; | |
var _enabled = null; | |
var _current = null; | |
var _current_img = null; | |
var _slides = []; | |
var _loaded = []; | |
function init(opts) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DV.HSL = function(opts) { | |
var _defaults = { | |
hue: 0.0, | |
sat: 0.0, | |
lum: 0.0 | |
}; | |
this.config = $.extend(this._defaults, opts); | |
this.hue_to_rgb = function(p, q, t) { |
OlderNewer