Skip to content

Instantly share code, notes, and snippets.

View hramos's full-sized avatar

Héctor Ramos hramos

View GitHub Profile
@hramos
hramos / gowalla_client
Created March 4, 2011 18:12
Snippet for Gowalla Rails Console client init
Gowalla::Client.new(:api_key => ENV['GOWALLA_API_KEY'], :api_secret => ENV['GOWALLA_API_SECRET'])
@hramos
hramos / _InfiniteTableViewController.m
Created January 24, 2011 15:29
Infinite Load More Table View Example
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
if(_reachedEndOfFeed) return;
if(!_dynamicFeed) return;
DLog();
if (!reloading)
{
checkForRefresh = YES; // only check offset when dragging
}
@hramos
hramos / deploy.sh
Created January 22, 2011 02:18
Single Deployment Script
./buildandarchive.sh
../distribution/deploy-testflight.sh
scp ../distribution/APPNAME.ipa USER@SERVER:/var/www/VIRTUALHOST/PATH_TO_BETA
@hramos
hramos / _manifest-link.html
Created January 11, 2011 14:49
OTA Manifest URL
@hramos
hramos / index.html
Created January 11, 2011 14:41
Sample Link to Manifest for use in Over The Air iOS deployment
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Google +1 - Beta Release</title>
<style type="text/css">
body {background:#fff;margin:0;padding:0;font-family:arial,helvetica,sans-serif;text-align:center;padding:10px;color:#333;font-size:16px;}
#container {width:320px;}
h1 {margin:0;padding:0;font-size:14px;}
@hramos
hramos / manifest.plist
Created January 11, 2011 14:29
Sample manifest file for Over The Air iOS deployment
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
@hramos
hramos / buildandarchive.sh
Created January 11, 2011 04:25
Build and Archive script from command line. Use with testflight deployment script, or upload .ipa to web server (use iOS Beta Builder to create initial manifest files)
MY_USERNAME="username"
CONFIGURATION_NAME="Ad Hoc" # Distribution, Ad Hoc...
PROJDIR="/path-to-your-xcode-project"
APPLICATION_NAME="myapplication"
PROJECT_NAME="${APPLICATION_NAME}" # .xcodeproj ommitted
TARGET_SDK="iphoneos4.2" # current sdk
PROJECT_BUILDDIR="/Users/${MY_USERNAME}/path-to-build-dir/${CONFIGURATION_NAME}-iphoneos"
TARGET_TEST_NAME="${APPLICATION_NAME}"
BUILD_HISTORY_DIR="${PROJDIR}/distribution/" # write ${APPLICATION_NAME}.IPA here
DEVELOPER_NAME="Your Name (Bundle Prefix If Applicable)" # mine was company name
@hramos
hramos / upload-testflight.sh
Created January 11, 2011 03:51
Deploy builds to Testflight with this script. Use a git wrapper (i.e. git push-and-deploy) to invoke git push, then xcodebuild, then this script.
#!/bin/sh
FILE=@FILENAME.ipa
API_TOKEN='<api key under account>'
TEAM_TOKEN='<team token under specific team>'
NOTES='Buildscript'
ENDPOINT=http://testflightapp.com/api/builds.json
DISTRIBUTION_LISTS='Internal'
curl $ENDPOINT -F file=$FILE -F api_token=$API_TOKEN -F team_token=$TEAM_TOKEN -F notify=true -F distribution_lists=$DISTRIBUTION_LISTS -F notes=$NOTES
@hramos
hramos / CGRectPrintFrame
Created December 27, 2010 19:34
Print CGRect frame to console
#define PrintFrame(frame) NSLog(@"F X:%f Y:%f W:%f H:%f", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
Using Inbox for user: (null) with password: (null)
2010-07-22 18:08:06.171 Gust[57477:307] before retrive saved messages: (null)
2010-07-22 18:08:06.176 Gust[57477:307] copy db into document directory.
2010-07-22 18:08:06.322 Gust[57477:307] after retrive saved messages: (
)
2010-07-22 18:08:06.326 Gust[57477:307] https://go.urbanairship.com/api/user/(null)/messages/
2010-07-22 18:08:06.389 Gust[57477:307] Inbox not initialized. Waiting for Device Token.
2010-07-22 18:08:10.683 Gust[57477:307] Connection ERROR: NSError query result: Error Domain=ASIHTTPRequestErrorDomain Code=3 "Authentication needed" UserInfo=0x189270 {NSLocalizedDescription=Authentication needed} for URL: GET - https://go.urbanairship.com/api/user/(null)/messages/
2010-07-22 18:08:10.688 Gust[57477:307] Using U/P: (null) / (null)
2010-07-22 18:08:10.691 Gust[57477:307] Body: (null)