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
ruby-1.9.2-p136@sandbox (git::master)@/sandbox/em-mongo/em-mongo [23:32:01] :( $ rvm gemset create emmongo | |
info: 'emmongo' gemset created (/Users/danhealy/.rvm/gems/ruby-1.9.2-p136@emmongo). | |
ruby-1.9.2-p136@sandbox (git::master)@/sandbox/em-mongo/em-mongo [23:32:11] :) $ rvm gemset use emmongo | |
info: Now using gemset 'emmongo' | |
bnruby-1.9.2-p136@emmongo (git::master)@/sandbox/em-mongo/em-mongo [23:32:16] :) $ bundle install | |
Fetching https://github.com/mloughran/em-spec.git | |
remote: Counting objects: 272, done. | |
remote: Compressing objects: 100% (153/153), done. | |
remote: Total 272 (delta 110), reused 260 (delta 103) | |
Receiving objects: 100% (272/272), 32.38 KiB, done. |
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
ruby-1.9.2-p180 @~ [10:27:37] :) $ env | grep ^rvm | |
rvm_gemsets_path=/Users/dan/.rvm/gemsets | |
rvm_scripts_path=/Users/dan/.rvm/scripts | |
rvm_bin_path=/Users/danbin | |
rvm_man_path=/Users/danshare/man | |
rvm_gemset_create_on_use_flag=1 | |
rvm_user_path=/Users/dan/.rvm/user | |
rvm_wrappers_path=/Users/dan/.rvm/wrappers | |
rvm_patches_path=/Users/dan/.rvm/patches | |
rvm_docs_path=/Users/dan/.rvm/docs |
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
// platform/iphone/OpenFeintExtension.h | |
#import "OpenFeint.h" | |
#import "OFAchievement.h" | |
#import "OFAchievementService.h" | |
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
ruby-1.9.2-p290@sandbox @/sandbox [11:58:10] :) $ ab -n 100 -c 1 http://goliath-demo.herokuapp.com/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking goliath-demo.herokuapp.com (be patient).....done | |
Server Software: PostRank | |
Server Hostname: goliath-demo.herokuapp.com |
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
source :rubygems | |
gem "eventmachine", ">= 1.0.0.beta.3" | |
gem 'goliath', :git => 'git://github.com/postrank-labs/goliath.git' | |
gem 'em-synchrony', :git => 'git://github.com/igrigorik/em-synchrony.git' |
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
#!/usr/bin/env ruby | |
class Array | |
def sum | |
inject(0.0) { |result, el| result + el } | |
end | |
def mean | |
sum / size | |
end |
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
batch_size = 100 # Items per request | |
parallel_requests = 4 | |
total_items_to_request = 4000 | |
iterations = (total_items_to_request / (parallel_requests * batch_size)) # => 10 | |
parallel_requests.times do |seg| | |
Process.fork do | |
c = AWS::DynamoDB::Client.new( | |
:access_key_id => "...", |
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
diff --git a/src/sprite.cpp b/src/sprite.cpp | |
index 450e5f4..f3320c8 100644 | |
--- a/src/sprite.cpp | |
+++ b/src/sprite.cpp | |
@@ -54,6 +54,25 @@ sprite_new(VALUE rcv, SEL sel, VALUE name) | |
return rb_class_wrap_new((void *)sprite, rcv); | |
} | |
+/// @method #create_with_image(data, len) | |
+/// Creates a sprite from +data+ stream buffer image data and +len+ length |
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
04714a3cc0a7adb56767f592a79c5c74b83e8ed6f4cf26831a5c5f0d07b54ac28d7fe519dd3350894abc4b29d57eb60a8b3609aac96e095ba384d556bfa7d22377;TheCrow1213 |
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
# Initialize an array of 50 random integers. If you know ahead of time that the | |
# elements will be unique, use Set class instead for performance improvements | |
array = Array.new(50) do rand(100) end | |
# Ruby 2.4 and later has the Array#sum method which could also be implemented as | |
# a simple #inject call in earlier versions, it's also mixed in with Rails | |
avg = array.sum / array.length.to_f # to_f required for float precision | |
# Removing the min and max of the array by sorting. This particular method |
OlderNewer