Skip to content

Instantly share code, notes, and snippets.

View gertig's full-sized avatar

Andrew Gertig gertig

View GitHub Profile
@binho
binho / index.html
Last active August 29, 2015 13:56
install app page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
Instructions:
1. Get UDID of the client device via iTunes.
2. Send the device UDID to developer portal.
3. Generate a new build with the UDID of the client.
4. Archive to enterprise distribribution and save in your machine.
5. Change MyApp.plist in this file to your generate plist file, the
@jimsynz
jimsynz / api_controller.rb
Created March 19, 2014 01:42
Ember API Token
# app/controllers/api_controller.rb
class ApiController < ApplicationController
skip_before_action :verify_authenticity_token
respond_to :json
rescue_from UserAuthenticationService::NotAuthorized, with: :not_authorized
rescue_from ActiveRecord::RecordNotFound, with: :not_found
before_filter :api_session_token_authenticate!
private
@markrickert
markrickert / example_usage.rb
Last active August 29, 2015 14:03
RubyMotion In App Purchase example
def purchase_single_product(identifier)
NSLog "Starting purchase process for #{identifier}."
@iap_helper = IAPHelper.new(NSSet.setWithArray([identifier]))
@iap_helper.cancelled = cancelled_transaction
@iap_helper.success = transaction_successful
@iap_helper.request_product_info do |success, products|
if success && products.is_a?(Array) && products.count == 1
@iap_helper.buy_product(products.first)
else

react-arduino

React has revolutionized the way we write user interfaces. It brings an extremely simple mental model to the authoring of UIs. React-native, react-canvas, and other projects have shown us that this model extends beyond the browser DOM.

I believe that this functional, predictable approach can also revolutionize how we build real-world user interfaces.

@simeonwillbanks
simeonwillbanks / oa-identity.md
Created June 1, 2011 17:10
#omniauth #oauth OmniAuth oa-identity
@jumski
jumski / backbone_sync_hack.coffee
Created August 5, 2011 17:10
BackboneJS sync hack to namespace params when saving/updating model
###
Usage:
* add model.name property that will be used as a namespace in the json request
* put this code before your Backbone app code
* use toJSON() as usual (so there is no namespacing in your templates)
* your model's data will be sent under model.name key when calling save()
###
# save reference to Backbone.sync
Backbone.oldSync = Backbone.sync
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat maxY = scrollView.contentSize.height+scrollView.contentInset.bottom;
CGFloat botY = scrollView.contentOffset.y+scrollView.frame.size.height;
NSLog(@"y = %f, maxY = %f", botY, maxY);
if(botY >= maxY) {
// load next page
}
}
@ashfurrow
ashfurrow / Best way to notify View Controller of In-App Purchase
Created February 12, 2012 00:45
Best way to notify View Controller of In-App Purchase
So I have a View Controller that responds to user requests for a non-consumable in-app purchase. The VC invokes a method in the app delegate which serves as the SKProductQueueDelegate, so it'll receive confirmation that the IAP succeeded or not.
My question is: how would you notify the original VC that it should update the UI and unlock the purchased feature? I'm thinking NSNotification but I'm also considering retaining the VC in the app delegate.
@aledalgrande
aledalgrande / gist:1845935
Created February 16, 2012 15:58
Capistrano configuration for RVM, bundler, Sinatra and Unicorn
require "bundler/capistrano"
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, '1.9.2@sinatroxy'
set :rvm_type, :system
set :bundle_flags, "--deployment"
set :application, "sinatroxy"
set :repository, "xxx@yyy:sinatroxy"
@gertig
gertig / gist:1989090
Created March 6, 2012 21:36
Replace double quotes with two single quotes
var str = "Dear diary "this" is a string with quotes."
str.replace(/"([^"]*)"/g, "''$1''");