Skip to content

Instantly share code, notes, and snippets.

@ebonical
ebonical / gist:464566
Created July 5, 2010 18:19
css clearfix
<style type="text/css">
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
</style>
@ebonical
ebonical / push
Created October 11, 2010 18:50
git push shortcut
#!/usr/bin/env ruby -wKU
def push_branch(branch)
puts "pushing branch: #{branch}"
`git push origin #{branch}`
end
if branch = ARGV[0]
push_branch(branch)
else
branches = `git branch`
@ebonical
ebonical / pomodoro.rb
Created May 25, 2011 13:05
Script for starting Pomodoro
#!/usr/bin/env ruby -w0
#
# Using Pomodoro app by iUgol
# http://itunes.apple.com/en/app/pomodoro/id417574133?mt=12
#
require "rubygems"
require "appscript" # gem install rb-appscript
include Appscript
@ebonical
ebonical / bookmark_on_delicious.applescript
Created June 8, 2011 17:34
Bookmark active Chrome tab on Delicious
#!/usr/bin/osascript
tell application "Google Chrome"
activate
tell window 1
tell active tab
execute JavaScript "(function(){f='http://www.delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&notes='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=6&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv6','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"
end tell
end tell
end tell
@ebonical
ebonical / toggle_quotes.py
Created June 27, 2012 17:24
Toggle double/single quotes in Sublime Text 2
# Also insert this into you key bindings...
# { "keys": ["ctrl+shift+'"], "command": "toggle_quotes"}
#
import sublime, sublime_plugin
class ToggleQuotesCommand(sublime_plugin.TextCommand):
def run(self, edit):
sels = list(self.view.sel())
for region in self.view.sel():
scope = self.view.scope_name(region.begin())
@ebonical
ebonical / application.rb
Last active December 12, 2015 05:48
Making sure assets precompile correctly on Heroku. Specifically to get `image-url` helper working correctly.
# See https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar/#troubleshooting
#
# Place in config/application.rb
config.assets.initialize_on_precompile = false
@ebonical
ebonical / encode_gdepth
Created July 7, 2015 13:56
Encode depthmap metadata inside a JPEG
#!/usr/bin/env ruby
require "optparse"
require "base64"
require "digest"
require "ostruct"
require "fileutils"
class Options
def self.help
@ebonical
ebonical / keybase.md
Created February 5, 2016 11:48
Keybase identity

Keybase proof

I hereby claim:

  • I am ebonical on github.
  • I am ebonical (https://keybase.io/ebonical) on keybase.
  • I have a public key ASBIwUIFOn3KCGkY8d3sKFhCLj6bgI0lg871cCwOibq4Xgo

To claim this, I am signing this object: