Skip to content

Instantly share code, notes, and snippets.

View hramos's full-sized avatar

Héctor Ramos hramos

View GitHub Profile
@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 / _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 / 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 / superfeedrgowalla.rb
Created March 5, 2011 16:23
Sample of how to parse superfeedr gowalla checkin objects
def self.create_with_superfeedr_response(json_response)
create! do |checkin|
checkin.activity_url = json_response["activity_url"]
checkin.user_id = json_response["user_id"]
if json_response["object"]
spot_hash = Hash.new
#spot_hash["image_url"] = ?
spot_hash["lat"] = json_response["geo"]["coordinates"][0]
spot_hash["lng"] = json_response["geo"]["coordinates"][1]
spot_hash["name"] = json_response["object"]["title"]
@hramos
hramos / superfeedrgowalla.rb
Created March 5, 2011 16:28
superfeedr lssnr
def parse_superfeedr_checkin
json_response = Hash.new # parse from superfeedr
checkin_url = "" #get from superfeedr
user_id = "" # get from superfeedr
user = User.find(user_id) # else could get username from superfeedr and fetch by_nickname
if user
checkin = user.checkins.find_by_url(checkin_url) || user.checkins.create_with_superfeedr_response(json_response)
end
end
<% form_for fanpage do |form| %>
<%= image_submit_tag("trackstar-selected-icon.png") %>
<% end %>
<% if current_user.fanpages.include?(fanpage) %>
<%= link_to image_tag("trackstar-selected-icon.png", :width => "24", :height => "24")%>
<% else %>
<%= link_to image_tag("trackstar-unselected-icon.png", :width => "24", :height => "24")%>
<% end %>
@hramos
hramos / PFRequest_0.2.15_snippet.m
Created September 27, 2011 03:08
Parse SDK 0.2.15 is blocking main thread when preparing to upload a PFObject with lots of data. Moving this to a background thread avoids UI freeze
// original file: PFRequest.m
- (void)buildAndSignPostBody {
for (NSString *key in self.command.params) {
[self setPostValue:[self.command.params objectForKey:key] forKey:key];
}
// This also ensures that posts are not empty, which would break various things
[self setPostValue:[NSString stringWithFormat:@"i%@", PARSE_VERSION] forKey:@"v"];
@hramos
hramos / prpitches
Created October 15, 2011 00:07
pr startupweekend pitches
1. stackoverflow-learn-programming-videos/aggr
2. global game geography
3. table-order
4. ?
5. control de energia, gastos energéticos
6. vieques - finanzas, restauración de crédito (needs legal assistance and web dev)
7. miguel - mala experiencia en taxi. incentivos para taxistas dar milla extra (pr lo hace mejor). tweet tip! Twitter Tips. Usar #tags para calcular que taxicabs ganan propinas.
8. imagine it - pasajes virtuales. designer, prog, legal
9. tareas
@hramos
hramos / checkpush.sh
Created November 2, 2011 17:10
Check Push-enabled app before submission
Via @tapbot_paul https://twitter.com/#!/tapbot_paul/status/91681340344381441
codesign -dvvvv --entitlements - Tweetbot.app
Original:
Ugh freaking provisioning profiles. PSA check your push app with the following. codesign -dvvvv --entitlements - Tweetbot.app