Skip to content

Instantly share code, notes, and snippets.

View gist:9748682
### Keybase proof
I hereby claim:
* I am edibiase on github.
* I am edibiase (https://keybase.io/edibiase) on keybase.
* I have a public key whose fingerprint is EA3E B7ED C2D5 7D2C 58C1 F5DF FA41 C937 CEB6 90E0
To claim this, I am signing this object:
View sample.rb
100.times {
puts Benchmark.measure {
lines = []
IO.readlines(ARGV[0]).each {|line|
word, probability = line.split(/\s+/)
lines << {:word => word, :probability => probability.to_f}
}
words = []
(ARGV[1] ? ARGV[1].to_i : 1).times {
View gist:45274
javascript:if%20(document.getElementById('download-youtube-video')==null%20&&%20!!(document.location.href.match(/http:%5C/%5C/%5Ba-zA-Z%5C.%5D*youtube%5C.com%5C/watch/)))%20%7Bvar%20yt_mp4_path='http://www.youtube.com/get_video?fmt=18&video_id='+swfArgs%5B'video_id'%5D+'&t='+swfArgs%5B't'%5D;%20var%20div_embed=document.getElementById('watch-embed-div');div_embed.innerHTML=div_embed.innerHTML+'%3Cbr%20/%3E%20%3Cspan%20id=%5C'download-youtube-video%5C'%3E%3Ca%20href=%5C''+yt_mp4_path+'%5C'%3EDownload%20as%20MP4%3C/a%3E%20(right-click%20and%20select%20%3Ci%3ESave%20'+%20(navigator.appName=='Microsoft%20Internet%20Explorer'?'target':'link')%20+'%20as%3C/i%3E)%3C/span%3E';%7Dvoid(0);
View foo.m
#import <Foundation/Foundation.h>
#import "iTunes.h"
#import "iTunesLibraryDumperKeys.h"
NSMutableDictionary *mutableDictionaryForItem(iTunesItem *item) {
return [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:[item id]], EZiTunesLibraryDumperKeyItemID,
[NSNumber numberWithInteger:[item index]], EZiTunesLibraryDumperKeyItemIndex,
[item name], EZiTunesLibraryDumperKeyItemName,
[item persistentID], EZiTunesLibraryDumperKeyItemPersistentID,
View Untitled
# Copyright 2008 Chris Wanstrath
# Taken from defunkt's gist repository: http://github.com/defunkt/gist/tree/master
require 'open-uri'
require 'net/http'
module Gist
extend self
@@gist_url = 'http://gist.github.com/%s.txt'
View Untitled
# Copyright 2008 Chris Wanstrath
# Taken from defunkt's gist repository: http://github.com/defunkt/gist/tree/master
require 'open-uri'
require 'net/http'
module Gist
extend self
@@gist_url = 'http://gist.github.com/%s.txt'
View Untitled
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>OmniOutliner Professional</string>
<key>CFBundleGetInfoString</key>
<string>OmniOutliner Professional Clipping Service 3.7.2, version 143.38, Copyright 2000-2008 The Omni Group</string>
View Untitled.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>OmniOutliner Professional</string>
<key>CFBundleGetInfoString</key>
<string>OmniOutliner Professional Clipping Service 3.7.2, version 143.38, Copyright 2000-2008 The Omni Group</string>
View Untitled
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>OmniOutliner Professional</string>
<key>CFBundleGetInfoString</key>
<string>OmniOutliner Professional Clipping Service 3.7.2, version 143.38, Copyright 2000-2008 The Omni Group</string>
View Untitled
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>OmniOutliner Professional</string>
<key>CFBundleGetInfoString</key>
<string>OmniOutliner Professional Clipping Service 3.7.2, version 143.38, Copyright 2000-2008 The Omni Group</string>