Skip to content

Instantly share code, notes, and snippets.

View jamonholmgren's full-sized avatar

Jamon Holmgren jamonholmgren

View GitHub Profile
@jamonholmgren
jamonholmgren / Slider.js
Created August 8, 2012 00:54
Slider class example
// Create the Slider class and extend Class.
var Slider = Class.extend(function($el) {
// This is the constructor. First we call the base class's constructor:
Slider.base.call(this);
// Then we do any instantiation
this.target = $el;
this.open = false;
// This is for keeping track of all Slider instances
Slider.all.push(this);
});
@jamonholmgren
jamonholmgren / spinner_helper.rb
Created October 1, 2012 01:41
MBProgressHUD helper (only usable within a UIViewController or something with a self.view accessor)
#
# Usage:
# spinner_on title: "Loading..."
# App.run_after 4 do
# spinner_off
# # more...
# end
#
module SpinnerHelper
def spinner_on(args = {})
@jamonholmgren
jamonholmgren / importing.rb
Created October 1, 2012 01:51
Async and spinner helper in action
@hud = spinner_on labelText: "Importing..."
Friend.eq(user: User.current_user).order(name: :asc).fetchAll do |friends|
import_queue = Dispatch::Queue.new("com.clearsightstudio.bigday.import_address_book_contacts")
friend_lookup = []
if friends
friends.each do |f|
friend_lookup << f.name
end
end
class UspsShipper
attr_accessor :order, :saddle
def usps
# removed usps api init code here...it works
end
def package
# Create the package
@package ||= Package.new(
def banner_view
@banner_view ||= begin
width = self.view.bounds.size.width
image = User.current_user.profile_image_view(67, 35)
image.frame = CGRectMake((width/2) - (67/2), 12, 67, 67)
BannerView.alloc.init(frame: self.view.frame, title: User.current_user.fullName, remote_image: image)
end
end
group :assets do
gem 'sass-rails', "~> 3.2.4"
gem 'coffee-rails'
gem 'uglifier'
gem 'compass-rails'
end
@jamonholmgren
jamonholmgren / app_delegate.rb
Last active December 13, 2015 23:29
app_delegate.rb
def on_load(application, options)
# ...
appearance_defaults
# ...
end
def appearance_defaults
UIApplication.sharedApplication.setStatusBarHidden true, animated:false
UITabBar.appearance.tintColor = "#123456".to_color
@jamonholmgren
jamonholmgren / messages_screen.rb
Created February 21, 2013 07:32
messages_screen.rb
class MessagesScreen < ProMotion::TableScreen
title "Messages"
def on_appear
poll_server
end
def table_data
@table_data ||= [{ title: "", cells: [] }]
end
@jamonholmgren
jamonholmgren / messages_screen.rb
Created February 21, 2013 07:33
messages_screen.rb
class MessagesScreen < ProMotion::TableScreen
title "Messages"
def on_appear
poll_server
end
def table_data
@table_data ||= [{ title: "", cells: [] }]
end
@jamonholmgren
jamonholmgren / search_modules_screen.rb
Created February 21, 2013 18:03
search_modules_screen.rb
class SearchModulesScreen < ProMotion::TableScreen
title "Modules"
# ...
def table_data
@modules ||= []
[{
title: "",
cells: @modules.map do |m|