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
isPortrait = ( | |
imgAspect > windowAspect | |
|| ( | |
img.naturalWidth > window.innerWidth | |
&& | |
img.naturalHeight < window.innerHeight | |
) | |
); |
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
require 'pry' | |
require 'pry-byebug' | |
require 'date' | |
require 'json' | |
def raw_samples | |
format = 's7c2s16' | |
samples = [] | |
open('./sample2.dat', 'rb') do |file| |
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
redis-cli KEYS *rails-cache* | xargs redis-cli DEL |
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
class BustleModel < Ohm::Model | |
include ActiveModel::Validations | |
def save | |
return false unless valid? | |
super | |
end | |
end | |
class Channel < BustleModel |
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
var elasticsearch = require('elasticsearch'); | |
var client = new elasticsearch.Client(); | |
var eventPattern = /([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\"/; | |
exports.handler = function(data, context) { | |
var events = []; | |
var encodedEvent, rawEvent, | |
matchedEvent, event, i, | |
commands; |
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 |
OlderNewer