This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'grit' | |
require 'active_support' | |
include Grit | |
merged_branches = `git branch -a --merged`.split("\n").collect(&:strip) - ["* master"] | |
repo = Repo.new(ARGV[0]) | |
merged_branches.each do |branch| | |
begin | |
last_commit = repo.commits(branch).first | |
last_time = Time.parse last_commit.to_hash['committed_date'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"in_reply_to_screen_name": null, | |
"in_reply_to_user_id": null, | |
"created_at": "Thu Mar 18 21:19:11 +0000 2010", | |
"in_reply_to_status_id": null, | |
"geo": { | |
"type": "Point", | |
"coordinates": [37.77576905, -122.40486341] | |
}, | |
"favorited": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<status> | |
<created_at>Thu Mar 18 21:19:11 +0000 2010</created_at> | |
<id>10689863523</id> | |
<text>As you can tell by this tweet, geo tagging is now available on mobile.twitter.com.</text> | |
<source><a href="http://mobile.twitter.com" rel="nofollow">mobile web</a></source> | |
<truncated>false</truncated> | |
<in_reply_to_status_id></in_reply_to_status_id> | |
<in_reply_to_user_id></in_reply_to_user_id> | |
<favorited>false</favorited> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rusage' | |
require 'pp' | |
require 'benchmark' | |
files = Dir['samples/**/*'] | |
command = case ARGV[0] | |
when 'gd2' | |
require 'gd2' | |
lambda do |file| | |
GD2::Image.import(file).resize(128, 128).export('/dev/null', :format => :jpeg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
void *dumb_thread(); | |
main(int argc, char *argv[]) | |
{ | |
int total = atoi(argv[1]); | |
int concurrency = atoi(argv[2]); | |
pthread_t pthread[concurrency]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread' | |
t = ARGV[0].to_i | |
c = ARGV[1].to_i | |
0.upto(t) do |i| | |
thread = [] | |
0.upto(c) do |j| | |
thread[j] = Thread.new { } | |
end | |
0.upto(c) do |j| | |
thread[j].join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(document.body.innerHTML = document.body.innerHTML.replace(/HTML5/g,"Java Applet")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Different ways to hook into an action | |
class ExampleAPI | |
def foo | |
puts "Foo" | |
end | |
end | |
# Option 1: alias_method_chain | |
class ExampleAPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let delay = 2.0 * Double(NSEC_PER_SEC) | |
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay)) | |
dispatch_after(time, dispatch_get_main_queue(), { | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UITableViewController { | |
var messages:[Message]? | |
var timer:NSTimer? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
override func viewDidAppear(animated: Bool) { | |
super.viewDidAppear(animated) |
OlderNewer