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:1477431
Created December 14, 2011 16:58
anonymous module namespacing bandwagon
(function($) {
})(jQuery);
@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 / 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 / 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
on runme(message)
if (item 1 of message = 176) and (item 2 of message = 19) then
tell application "System Events" to keystroke return
end if
if (item 1 of message = 176) and (item 2 of message = 20) then
tell application "System Events" to keystroke space
# create a shortcut for all applications
# shortcuts are launch_ e.g. to launch iPhoto = launch_iphoto
for app in /Applications/*.app
do
shortcut=`echo $app | ruby -ne 'puts "launch_"+File.basename($_).downcase.gsub(/.app/,"").gsub(/\s+/,"")'`
alias "$shortcut"="open $app"
done
@tastycode
tastycode / vimcopy.scpt
Created January 13, 2012 03:56
Vimcopy
-- with shell execution from http://neverblog.net/run-unix-commands-in-an-applescript/
tell application "System Events"
set front_app to item 1 of (get name of processes whose frontmost is true)
end tell
tell application "Terminal"
-- take the clipboard contents, pass through tr to remove odd newlines, write to vimcopy.txt, open vimcopy with vim,
-- the once closed, write vimcopy.txt contents to clipboard and exit
@tastycode
tastycode / gist_a.markdown
Created February 13, 2012 04:24
@pivotaltracker/story/show/24829297

foo bar

  • baz
  • boo
@tastycode
tastycode / gfm.markdown
Created March 13, 2012 02:14
GFM Preview

GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red Violets are blue

require 'set'
def search(&block)
query_config = Object.new
class << query_config
def method_missing method_name, *args, &block
sym_variable = "@#{method_name}".to_sym
return dynamic_set("@#{$1}", args.first) if method_name.to_s =~ /(.*)=$/
return dynamic_get(sym_variable) if user_variables.include? sym_variable