Skip to content

Instantly share code, notes, and snippets.

@radamant
radamant / gist:5113602
Created March 8, 2013 01:46
irb-openssl-fubar.log
irb
>> require 'open-uri'
=> true
>> open 'https://www.google.com'
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server key exchange B: bad ecpoint
from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect'
mencoder -nosound mf://*.jpg -mf w=800:h=371:type=jpg:fps=15 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2160000:mbd=2:keyint=132:v4mv:vqmin=3:lumi_mask=0.07:dark_mask=0.2:mpeg_quant:scplx_mask=0.1:tcplx_mask=0.1:naq -o face-time-lapse.avi
@radamant
radamant / current_branch_grep.rb
Created February 15, 2012 17:39
A feature branch git-grep script
#!/usr/bin/env ruby
require 'set'
@term = ARGV[0]
def set_from_command(command)
result = `#{command}`
Set.new(result.split "\n")
end
@radamant
radamant / gist:1372195
Created November 17, 2011 02:30
Install REE 1.8.7 with XCode 4.2
# using_gcc for 64btt compiling on lion (solves compatability issues)
function using_gcc() {
env CC="/usr/bin/gcc-4.2" ARCHFLAGS="-arch x86_32" ARCHS="x86_32" $*
}
#then
using_gcc rvm install ree
@radamant
radamant / gist:1114333
Created July 29, 2011 17:49
Alias Enumerable#map to Enumerable#transform
>> module Enumerable
>> alias_method :transform, :map
>> end
=> Enumerable
>> names.transform{|n| n.upcase}
=> ["FRYE", "BENDER", "LEELA", "ZOIDBERG"]
@radamant
radamant / ignoreEnterSpec.coffee
Created July 21, 2011 20:43
Jasmine spec in coffeescript
describe 'jQuery.fn.ignoreEnter', ->
beforeEach ->
setFixtures '<input />'
$('input').ignoreEnter()
describe 'pressing enter', ->
event = null
beforeEach ->
event = jQuery.Event 'keypress'

Marjoram / Thyme Chicken

Serves 2

Meat:

  • 2 chicken breasts

Rub:

@radamant
radamant / gist:969014
Created May 12, 2011 17:30
tmux.conf
unbind C-b
set -g prefix C-j
set-window-option -g mode-keys vi
bind r source-file ~/.tmux.conf
set -g status-fg black
set -g status-fg white
set -g status-left '#[fg=blue](#S) #[default]'
setw -g window-status-current-attr bold
setw -g window-status-current-fg white
set conf_name to text returned of ¬
(display dialog ¬
"Enter conference name:" with title ¬
"Schedule Conference" default answer ¬
"" default button 2)
tell application "Things"
set newProject to make new project ¬
with properties {name:conf_name}
end tell
@radamant
radamant / radamant.js
Created April 25, 2011 05:20
corny pseudo-js-english description of a web site
var radamant = Site({
supportsShittyBrowsers: false;
});
radamant.addFeature( CodeGallery({
interactive: true,
nonLinearPath: true,
linkable: true
}));