Skip to content

Instantly share code, notes, and snippets.

lelandbatey /
Last active Apr 30, 2022
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


drtoast / gist:7159912
Created Oct 25, 2013
Jailbreaking a Google Search Appliance
View gist:7159912
These are my notes from my abandoned project to wipe and reuse a Google Search Appliance:
Dell PowerEdge 2950 (model EMS01)
Disable BIOS Password
zadr / pre-push
Last active Dec 19, 2015
Prevent pushes that break the build.
View pre-push
# Requires git 1.8.2 or above. This excludes `git` from Xcode 4.6, but should include `git` from Xcode 5 and homebrew.
# Not perfect. If you've done anything since your last commit that breaks the build, this will incorrectly fail. Maybe do something like +
# Install by adding this file into .git/hooks, naming it `pre-push`
# go into the dir that contains the xcodeproj
cd Foo
# build the xcodeproj for your scheme (and/or configuration)
View oauth-v2-rfc6749.markdown

The OAuth 2.0 Authorization Framework

This document is intended to be a simplified version of the OAuth 2.0 specification. In particular it has been written with implementors in mind, and as such attempts to trim the spec down to just what you need to implement an OAuth provider or client. It is necessarily not complete, but attempts to introduce spec requirements in the same order in which the protocol proceeds in practise, with everything you need to know about each protocol endpoint brought together in one place rather than scattered across a large document.

fnichol /
Created Feb 26, 2012
A Common .ruby-version File For Ruby Projects

A Common .ruby-version File For Ruby Projects


I've been using this technique in most of my Ruby projects lately where Ruby versions are required:

  • Create .rbenv-version containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far...
  • Create .rvmrc (with rvm --create --rvmrc "1.9.3@myapp") and edit the environment_id= line to fetch the Ruby version from .rbenv-version (example below).

Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version.

bunnymatic / gist:1648765
Last active Feb 22, 2020
compute histogram in ruby
View gist:1648765
def tally inp; hash =; inp.each {|k,v| hash[k] +=v}; hash; end
def histogram inp; hash =; inp.each {|v| hash[v]+=1}; hash; end
def histogram2 inp; Hash[*inp.group_by{ |v| v }.flat_map{ |k, v| [k, v.size] }] end
def test_tally
tally([['a',1],['b',1],['a',1],['c',1],['a',3], ['c',1]]) == {'a'=>5, 'b'=>1, 'c'=>2}
def test_histogram
histogram(['a','b','a','c','a', 'c']) == {'a'=>3, 'b'=>1, 'c'=>2}
rudyjahchan / Rakefile
Created Jun 9, 2011
Building and Deploying iOS Projects through Rake
View Rakefile
require 'yaml'
require 'uri'
require 'tempfile'
require 'tmpdir'
SDK_DIR = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk"
PROJECT_DIR = File.dirname __FILE__
RUBIOS_DIR = File.join(PROJECT_DIR, 'rubios')
View quickerclip.rb
module Paperclip
class Geometry
def self.from_file file
class Thumbnail
def make
src = Test::FileHelper.fixture_file('white_pixel.jpg')
dst =[@basename, @format].compact.join("."))