Skip to content

Instantly share code, notes, and snippets.

View dblandin's full-sized avatar

devon blandin dblandin

View GitHub Profile
@dblandin
dblandin / keybase.md
Created May 14, 2014 21:48
keybase.md

Keybase proof

I hereby claim:

  • I am dblandin on github.
  • I am devon (https://keybase.io/devon) on keybase.
  • I have a public key whose fingerprint is 3A7C 29B2 1C93 5467 19AD 78CE A4A7 70EF EE20 148C

To claim this, I am signing this object:

@dblandin
dblandin / Rakefile
Last active June 17, 2016 15:30 — forked from ParkinT/Rakefile
RubyMotion Configuration and Deploy/Release
# -*- coding: utf-8 -*-
$:.unshift('/Library/RubyMotion/lib')
require 'motion/project/template/ios'
require 'bundler'
Dir.glob('./config/*.rb').each { |file| require file }
if ARGV.join(' ') =~ /spec/
Bundler.require :default, :development, :spec
elsif ARGV.join(' ') =~ /testflight/
@dblandin
dblandin / alerter.rb
Created February 10, 2014 21:26
RubyMotion Throttler *currently not working*
class Alerter
def alert(message)
NSLog("#{message}!")
end
end
@dblandin
dblandin / .env
Created January 19, 2014 19:06
Managing RubyMotion environment variables
TESTFLIGHT_APP_TOKEN=90210
TESTFLIGHT_TEAM_TOKEN=90210
TESTFLIGHT_API_TOKEN=90210
BUGSENSE_API_KEY=90210
BUGSENSE_API_TOKEN=90210
DEVELOPMENT_CERTIFICATE_NAME="iPhone Developer: yourName"
DEVELOPMENT_PROVISIONING_PROFILE_PATH="/path/to/development.mobileprovision"
module UIViewAdditions
def offsetPointToParentCoordinates(aPoint)
CGPointMake(aPoint.x + center.x, aPoint.y + center.y)
end
def pointInViewCenterTerms(aPoint)
CGPointMake(aPoint.x - center.x, aPoint.y - center.y)
end
def pointInTransformedView(aPoint)
@dblandin
dblandin / ui_image_view.rb
Created August 23, 2013 22:49
UIImageView with progress blocks
class UIImageView
def af_imageRequestOperation
@af_imageRequestOperation
end
def af_imageRequestOperation=(operation)
@af_imageRequestOperation = operation
end
def set_image_with_url(url)
class EventCell < UITableViewCell
IDENTIFIER = 'EventCell'
PADDING = 10
LEFT_MARGIN = 40
RIGHT_MARGIN = 20
attr_reader :event
def initWithStyle(style, reuseIdentifier: reuse_identifier)
super.tap do |cell|
@dblandin
dblandin / Gemfile
Created August 15, 2013 17:45
Storing secure data with RubyMotion
source 'https://rubygems.org'
gem 'cocoapods', '~> 0.23.0'
gem 'motion-cocoapods', '~> 1.3.6'
@dblandin
dblandin / DSCMultipartUploader.m
Created July 22, 2013 15:53
Inline function build error using RubyMotion 2.4
...
NSString * const ContentStringTypeJPEG = @"image/jpeg";
NSString * const ContentStringTypeVideo = @"video/mp4";
inline NSString *stringFromContentType(DSCMultipartContentType contentType)
{
switch (contentType) {
case DSCMultipartContentJPEG:
return ContentStringTypeJPEG;
break;
@dblandin
dblandin / Gemfile
Last active December 19, 2015 21:39 — forked from iwarshak/Gemfile
RubyMotion Papertrail Logger
source :rubygems
gem "rake"
gem 'motion-logger' #cocoalumberjack wrapper