Skip to content

Instantly share code, notes, and snippets.

View rcaetano's full-sized avatar

Richard Caetano rcaetano

View GitHub Profile
# 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]
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];
@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)
# Icon@2x.png (114x114)
# Icon-72.png (72x72)
# Icon-Small-50.png (50x50)
# Icon-Small.png (29x29)
# Icon-Small@2x.png (58x58)
#
@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 / 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: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:993501
Created May 26, 2011 16:48
.gitignore file for xcode
#----------------------------------------------------------------------
# Mac OS X noise
#----------------------------------------------------------------------
.DS_Store
profile
#----------------------------------------------------------------------
# XCode (and ancestors) per-user config (very noisy, and not relevant)
#----------------------------------------------------------------------
*.mode1
@rcaetano
rcaetano / AppDelegate
Created June 14, 2011 00:38
iAd Modified Implementation
#define SharedAdBannerView ((btcreportAppDelegate *)[[UIApplication sharedApplication] delegate]).adBanner
@interface btcreportAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UINavigationController *navigationController;
ADBannerView *adBanner;
}
@rcaetano
rcaetano / Description
Created February 10, 2012 13:29
BTC Bounty: 3BTC - Extract links/text from twitter and group by hashtag
Bounty: 3BTC
Expires: Feb 17, 2012
Submission and questions: caetano@gmail.com
Notes: Please post your source code using a public github:gist
Using Node.js, render links/text as HTML from a twitter feed and group by hashtag in alphabetical order
(All solutions submitted and winner will be listed below)
//
// VivaceLogoView.h
// zeon
//
// Created by Richard Caetano on 4/2/12.
// Copyright (c) 2012 Modal Software Corporation. All rights reserved.
//
#import <UIKit/UIKit.h>