Skip to content

Instantly share code, notes, and snippets.

View jkotchoff's full-sized avatar
💭
1's and 0's

Jason Kotchoff jkotchoff

💭
1's and 0's
View GitHub Profile
@jkotchoff
jkotchoff / Screen Shot 2013-09-24 at 1.15.18 PM.png
Last active December 23, 2015 19:08
on iOS7, certain strings do not render as visible on a Titanium Alert Dialog. This is a temporary workaround until a platform fix is released.
Screen Shot 2013-09-24 at 1.15.18 PM.png
@jkotchoff
jkotchoff / images2android.sh
Last active December 22, 2015 19:09 — forked from Arood/images2android.sh
Updated the gist for @_StockLight. As per @jeffbonnes advice at @ticonf melbourne 2013, this version expects a Resources/images directory (instead of Resources/iphone/images) that contains the standard and @2x images which are served straight to iOS and also MDPI Android devices.
type mogrify >/dev/null 2>&1 || { echo >&2 "» This script requires mogrify. Please install ImageMagick first!"; exit 1; }
rm -rf Resources/android/images
mkdir Resources/android/images
mkdir Resources/android/images/res-xhdpi
mkdir Resources/android/images/res-mdpi
echo " » Copying the splash screen"
cp Resources/iphone/Default.png Resources/android/images/res-mdpi/default.png
cp Resources/iphone/Default@2x.png Resources/android/images/res-xhdpi/default.png
@jkotchoff
jkotchoff / google_play_verification.rb
Last active July 6, 2023 17:57
Verifying an Android subscription in a Ruby on Rails app using the Google Play API
class GooglePlayVerification
require 'google/api_client'
# Refer:
# https://code.google.com/p/google-api-ruby-client/issues/detail?id=72
# and
# http://jonathanotto.com/blog/google_oauth2_api_quick_tutorial.html
# and
# http://milancermak.wordpress.com/2012/08/24/server-side-verification-of-google-play-subsc/
GOOGLE_KEY = 'xxx-xxx.apps.googleusercontent.com'
@jkotchoff
jkotchoff / interview_q1_spec.rb
Created May 23, 2012 23:43
Ruby on Rails Interview Question (1)
require 'rspec'
def format_money(amount)
'-1' #TODO
end
describe "format_money" do
context "when the amount is a simple fraction" do
subject{ 0.4 }
specify{ format_money(subject).should == "$0.40" }
require 'net/http'
# Extend img tag to optionally embed images in-line into HTML instead of referencing as a URI
#
# This is a useful technique when sending HTML emails as it circumvents the prompt many mail clients
# present seeking permission to 'display images from this sender?' when an email of mime-type 'html'
# contains <img> tags.
#
# ie. <%= image_tag('red_dot.gif', :embed_inline => "true") %>
#