Skip to content

Instantly share code, notes, and snippets.

View tastycode's full-sized avatar

Sasha Devol tastycode

  • Elsewhere Labs
  • New Orleans, LA
View GitHub Profile
@tastycode
tastycode / gist:1526544
Created December 28, 2011 05:33
Version Madness
if RUBY_VERSION >= '1.9'
require_relative '../lib/executor.rb'
else
require "lib/executor.rb"
end
@tastycode
tastycode / convert.rb
Created December 27, 2011 07:39
system commands gists
module FFMpeg
class Convert
attr_accessor :version, :total_time, :frame, :total_frames, :capturing,
:input_fps
def initialize(input, output, options={})
@input = input
@output = output
@options = options
@tastycode
tastycode / git status output
Created December 19, 2011 05:02
git notes
ECHO4:jsdiff vajrapani666$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: lib/jsdiff.rb
#
no changes added to commit (use "git add" and/or "git commit -a")
@tastycode
tastycode / gist:1477431
Created December 14, 2011 16:58
anonymous module namespacing bandwagon
(function($) {
})(jQuery);
@tastycode
tastycode / gist:1475693
Created December 14, 2011 08:10
potential best practice for namespacing libs and defining app namespace
var Application=(function($,_) {
}(jQuery.noConflict(), _.noConflict());
@tastycode
tastycode / gist:1475684
Created December 14, 2011 08:03
module pattern example
YAHOO.myProject.myModule = function () {
//"private" variables:
var myPrivateVar = "I can be accessed only from within YAHOO.myProject.myModule.";
//"private" method:
var myPrivateMethod = function () {
YAHOO.log("I can be accessed only from within YAHOO.myProject.myModule");
}
@tastycode
tastycode / jQuery
Created December 14, 2011 05:31
Alternatives to unclear syntax wandwagon
with ({$: jQuery.noConflict()}) {
console.log("Check me out", $);
}
console.log($);
@tastycode
tastycode / cachemark.rake
Created November 23, 2011 16:45
Rails Cache Strategy Benchmarks
require 'benchmark'
task :benchmark => :environment do
stores = {
:file_store=>[Rails.root+"/tmp/cache"],
:mem_cache_store=>["localhost"],
:dalli_store=>["localhost"],
:redis_store=> [],
:mongo_store=> [],
}
@tastycode
tastycode / gist:1252835
Created September 30, 2011 06:09
Metahash Documentation
require 'metahash'
# Writing to a file
mh = Metahash::Metahash.new "path/to/beiber.mp3"
mh["id3:artist"] = "Dave Meowtthews"
# Reading the metadata
mh = Metahash::Metahash.new "path/to/beiber.mp3"
puts mh.to_h
@tastycode
tastycode / overlay_src
Created August 30, 2011 05:08
fb_comment_layer
/*
Facebook Comment Layer
Adds a facebook comment feed to any page
*/
(function() {
//adapted from jQuerify bookmarklet loader
//http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet