Skip to content

Instantly share code, notes, and snippets.

View hramos's full-sized avatar

Héctor Ramos hramos

View GitHub Profile
- (void)viewDidLoad {
[super viewDidLoad];
float scaleBy = 0.80;
id<MKAnnotation> annotation; // Define to yours
self.mapView = [[[MKMapView alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 64 / scaleBy, 64 / scaleBy)] autorelease];
[self.mapView addAnnotation:job];
CLLocationCoordinate2D coordinate = annotation.coordinate;
coordinate.longitude -= 0.0006;
The building of things scratches an essential itch for engineers. It’s why they became engineers in the first place. When they were six, their Dad handed them two boards, a nail, and a hammer and they started whacking. BLAM BLAM BLAM. Even with the nail awkwardly bent in half, the wood was suddenly and magically bound together: a thing was built. At that moment, this junior engineer’s brain excreted a chemical that instantly convinced them of the disproportionate value of this construction. This is the best wood thing in the world because I built it. And then they looked up from their creation and pleaded, “Dad, I really need more nails”.
Dad handed them three more nails, showed them where to hold the hammer, and demonstrated how to hit the nail. More whacking. BLAM BLAM BIFF. This time the nail wasn’t bent, this time on the last hit the nail slid effortlessly into the wood. This engineer in training had now experienced two essential emotions: the joy of creation and the satisfaction of learning while gainin
source :rubygems
gem 'sinatra', '1.0'
gem 'oauth2'
gem 'json'
group :development do
gem 'shotgun'
end
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)
@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);
@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 / 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 / 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 / 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-link.html
Created January 11, 2011 14:49
OTA Manifest URL