This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is what you need to add to your applicationDidFinishLaunching | |
*/ | |
- (void)applicationDidFinishLaunching:(UIApplication *)application | |
{ | |
// Add registration for remote notifications | |
[[UIApplication sharedApplication] | |
registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; | |
// Clear application badge when app launches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'socket' | |
require 'rubygems' | |
require 'json' | |
# Takes json as an input and sends data to APNS over SSL | |
APNS_HOST = 'gateway.sandbox.push.apple.com' | |
APNS_PORT = 2195 | |
APNS_CERT_FILE_PATH = 'MyCert.pem' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product < ActiveRecord::Base | |
has_many :material_product_mappings, :dependent => :destroy, :inverse_of => :product | |
has_many :materials, :through => :material_product_mappings, :autosave => true | |
#... | |
rails_admin do | |
list do | |
field :material_product_mappings do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/views/layouts/application.html.erb | |
<% head_style 'styles' %> | |
<% head_javascript 'application' %> | |
<%= render :file => 'layouts/rails_admin/main' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/migrate/20101004063749_create_photos.rb | |
class CreatePhotos < ActiveRecord::Migration | |
def self.up | |
create_table :photos do |t| | |
t.string :name, :null => false | |
t.binary :data, :null => false | |
t.string :filename | |
t.string :mime_type | |
t.timestamps |
NewerOlder