Skip to content

Instantly share code, notes, and snippets.

View tylr's full-sized avatar

Tyler Love tylr

View GitHub Profile
PP.Rotator = function(){
_rotator = {
_opts: {
interval: 5,
rotate: function(){}
},
_timer: null,
start: function(){
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
# 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
module ShitCan
require 'memcached'
def self.load(con_path='localhost:11211')
@cache = Memcached.new(con_path)
end
def self.cache
if @cache
return @cache