View Bitcoin EC2 Performance test.md

EC2 settings

  • Instance type: t2.xlarge
  • vCPUs: 4
  • Memory (GiB): 16
  • General Purpose SSD (GP2): 200 GB
  • Ubuntu
  • Running in eu-central-1b (Frankfurt)

Hint: to make your life easier and allow login with a simple ssh btc-0.14, edit ~/.ssh/config:

View Makefile
resolutions := 58 76 80 120 152
all_FILES := $(foreach resolution, $(resolutions), icon-$(resolution).png)
all: $(all_FILES)
icon-%.png: icon-itunes-connect-1024.png
convert $< -resize $*x$* $@
icon-itunes-connect-1024.png: icon.svg
View bitcoin-pay.rb
#!/usr/bin/env ruby
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'pry'
require 'bigdecimal'
require 'bitcoin' # Because I need to cheat every now and then
# Usage:
# gem install pry json ffi ruby-bitcoin
View gist:5356176
// Observe and notify user if app has moved:
[[NSNotificationCenter defaultCenter] addObserverForName:@"AppHasMoved"
object:nil
queue:NSOperationQueuePriorityNormal
usingBlock:^(NSNotification *note) {
// Check if we've already told the user recently
NSDate *appHasMoved = [[NSUserDefaults standardUserDefaults] valueForKey:@"AlertAppHasMoved"];
int interval = 7*24*60*60;
if (appHasMoved == nil ||
[appHasMoved compare:[[NSDate date] dateByAddingTimeInterval:-interval]] == NSOrderedAscending) {
View gist:5356100
NSNumber* appHasMoved = [JSON objectForKey:@"app_has_moved"];
if(appHasMoved != nil && [appHasMoved boolValue]) {
// Notify the user that the app has moved.
[[NSNotificationCenter defaultCenter] postNotificationName:@"AppHasMoved"
object:self
userInfo:@{
@"new_app_location" : [JSON objectForKey:@"new_app_location"],
@"app_has_moved_message" : [JSON objectForKey:@"app_has_moved_message"],
@"app_has_moved_title" : [JSON objectForKey:@"app_has_moved_title"]
}
View gist:5356032
{
'app_has_moved' : true,
'new_app_location' : "https://itunes.apple.com/nl/app/your_new_app/idNEW_APP_ID?mt=8",
'app_has_moved_message' : "In order to stay current, please re-download the app from this location. Apologies for the inconvenience."
}
View Gemfile.lock
GIT
remote: git://github.com/flying-sphinx/flying-sphinx.git
revision: 49bfed5d91b0afb06390fd50f4e058662f342907
specs:
flying-sphinx (0.6.4)
faraday_middleware (~> 0.7.0)
multi_json (>= 1.0.1)
net-ssh (>= 2.0.23)
rash (~> 0.3.0)
riddle (>= 1.5.0)
View robot_user_agents.rb
require 'net/http'
require 'xmlsimple'
url = "http://www.user-agents.org/allagents.xml"
xml_data = Net::HTTP.get_response(URI.parse(url)).body
data = XmlSimple.xml_in(xml_data)
agents = data['user-agent'].select{|agent| type = agent["Type"].first; type.include?("R") || type.include?("S")}
agent_names = agents.collect {|agent| agent["String"].first}
View Gemfile.rb
source 'http://rubygems.org'
gem 'rails', '>=3.0.0'
gem 'rake', ">=0.9.2"
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
gem 'cancan', ">=1.3.2"
gem 'haml',">=3.0.9"
gem 'rails3-jquery-autocomplete', '0.3.2'
gem 'paperclip'
gem 'json'