Skip to content

Instantly share code, notes, and snippets.

View rcaetano's full-sized avatar

Richard Caetano rcaetano

View GitHub Profile
@rcaetano
rcaetano / gist:993497
Created May 26, 2011 16:45
Sample gemrc file
~ $ cat ~/.gemrc
---
:update_sources: true
:bulk_threshold: 1000
:sources:
- http://gems.rubyforge.org
- http://gems.github.com
gem: --no-ri --no-rdoc
:verbose: true
:benchmark: false
@rcaetano
rcaetano / gist:993399
Created May 26, 2011 15:52
Scripts for setting up amazon EC2 instances to mine bitcoins
# miner_pool.sh - executes a script against each instance: ./mine_pool.sh setup.sh
# list your instances here
# use ami-12b6477b
INSTANCES="ec2-50-19-52-212.compute-1.amazonaws.com
ec2-50-16-126-107.compute-1.amazonaws.com
ec2-184-72-177-183.compute-1.amazonaws.com
ec2-50-17-126-57.compute-1.amazonaws.com
ec2-184-73-119-153.compute-1.amazonaws.com"
@rcaetano
rcaetano / gist:921826
Created April 15, 2011 14:54
Get bundle version from info.plist
NSString* version = @"Version (unknown)";
NSDictionary* dict = [[NSBundle mainBundle] infoDictionary];
if (dict) {
version = [NSString stringWithFormat:@"Version %@",
[dict objectForKey:@"CFBundleVersion"]];
}
@rcaetano
rcaetano / iOS Project Icons
Created February 22, 2011 11:29
Creates the required iOS icons
#!/bin/bash
#
# Creates the required icon images for iOS:
# Icon.png (57x57)
# [email protected] (114x114)
# Icon-72.png (72x72)
# Icon-Small-50.png (50x50)
# Icon-Small.png (29x29)
# [email protected] (58x58)
#
UITextView * nameView = [[UITextView alloc] initWithFrame:CGRectMake(0, 200, 350, 50)];
nameView.text = @"hello world, overwrite me";
nameView.transform = CGAffineTransformMakeRotation( CC_DEGREES_TO_RADIANS( 90.0f ) );
nameView.delegate = self;
[nameView setReturnKeyType:UIReturnKeyDone];
[[[CCDirector sharedDirector] openGLView] addSubview:nameView];
# This rewrites all dynamic requests to /system/maintenance.html if that
# file exists, this file is created by Capistrano's disable task.
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]