Skip to content

Instantly share code, notes, and snippets.

View zackchandler's full-sized avatar

Zack Chandler zackchandler

  • Urbandoor
  • San Francisco Bay Area
View GitHub Profile
@zackchandler
zackchandler / shopify_app_gem_monkey_patch.rb
Created April 20, 2014 03:41
shopify_app_gem_monkey_patch.rb
module ShopifyApp::LoginProtection
def shopify_session
if shop_session
begin
# session[:shopify] set in LoginController#show
ShopifyAPI::Base.activate_session(shop_session)
yield
ensure
ShopifyAPI::Base.clear_session
@zackchandler
zackchandler / run_automation.sh
Created October 31, 2012 18:03
Trying to tweak AutomationExample to run on device...
# ...
./unix_instruments \
-w 3b497a50faa1e345a73924e159c2703308ea5871 \
-D automation_results/trace \
-t UIAutomationTemplate.tracetemplate \
$BUILD_DIR/AutomationExample.app \
-e UIARESULTSPATH automation_results \
-e UIASCRIPT automation_script.js
require 'timeout'
def block_until_instance_is_sshable!(timeout=120)
start = Time.now
while ((Time.now - start) < timeout) do
begin
Timeout::timeout(5) {
# INSERT CODE HERE TO TRY TO SSH
return true
}
dyld: lazy symbol binding failed: Symbol not found: _STR2CSTR
Referenced from: /Users/zackchandler/.rvm/gems/ruby-1.9.2-p0@rails3app/gems/sqlite3-ruby-1.2.4/lib/sqlite3_api.bundle
Expected in: flat namespace
~/dev $ git clone http://github.com/ry/node.git
Initialized empty Git repository in /Users/zackchandler/dev/node/.git/
got 75f0cf471af3c029290d4bf55c34d1fc470ef600
walk 75f0cf471af3c029290d4bf55c34d1fc470ef600
Getting alternates list for http://github.com/ry/node.git
Getting pack list for http://github.com/ry/node.git
Getting index for pack a95bae93307c7b102d13cf6c0f110e29ecde36aa
Getting index for pack 3d8b7812c7467dcf06fbd126680512baa076c00f
Getting index for pack 6bbcda776e7940e5d997eb83e59acf1bc521bb7d
Getting index for pack b21dcb403ea73e8d045a00276e6b736280a9773b
SIZES = Hash.new(0) # return zero for any unknown size
SIZES[:small] = 1
SIZES[:medium] = 2
SIZES[:large] = 3
class Plane
attr_accessor :type, :size
attr_reader :priority
def initialize(options={})
execute 'custom-install' do
command '/data/myapp/custom_install.sh'
end
<?xml version="1.0"?>
<ReceivePaymentQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE" retCount="INTTYPE" iteratorRemainingCount="INTTYPE" iteratorID="UUIDTYPE">
<ReceivePaymentRet>
<!-- optional, may repeat -->
<TxnID>IDTYPE</TxnID>
<!-- optional -->
<TimeCreated>DATETIMETYPE</TimeCreated>
<!-- optional -->
<TimeModified>DATETIMETYPE</TimeModified>
<!-- optional -->
<?xml version="1.0"?>
<customer>
<name>ABC Company</name>
<service_address>123 First St</service_address>
<service_city>Fudge</service_city>
<service_state>CA</service_state>
<service_zip_code>55555</service_zip_code>
<primary_contact_attributes>
<first_name>John</first_name>
<last_name>Doe</last_name>
<html>
<head>
<title>Estimate</title>
<style type="text/css">
body { margin: 20px 50px 20px 50px; color: #000080; }
#customer { margin-left: 15px; }
table { width: 100%; font-size: 10px; border-collapse: collapse; }