Skip to content

Instantly share code, notes, and snippets.

View cactis's full-sized avatar

chitsung.lin cactis

View GitHub Profile
@twerth
twerth / example.rb
Created March 23, 2013 17:58
A simple example of creating a UIView with a UICollectionView as a subview in RubyMotion using Teacup for styling
# A simple example of creating a UIView with a UICollectionView as a subview
# in RubyMotion using Teacup for styling
#
# Your controller will need to set the stylesheet: stylesheet :example
# and create this view like so: subview Example, :my_example_view
class Example < UIView
CELL_IDENTIFIER = 'example_cell'
def initWithFrame(frame)
@Bodacious
Bodacious / Rakefile
Created August 23, 2012 11:19
my Rakefile for lastest Rubymotion app
$:.unshift("/Library/RubyMotion/lib")
require File.join(File.dirname(__FILE__), 'version')
require 'motion/project'
require 'bundler'
Bundler.require
@markrickert
markrickert / webview.m
Created August 21, 2012 20:22
Load RubyMotion links from a UIWebView in Safari
//Here's the same thing in Objective-C
#import "WebView.h"
@implementation WebView
@synthesize webView = _webView;
-(void) viewDidLoad
{
@scotttam
scotttam / apns.rb
Created January 31, 2012 15:51
Sends an Apple Push Notification with Ruby
require "rubygems"
require "yajl"
require "openssl"
require "socket"
device_token = '39cac56f 986a0e66 3c4fd4f4 68df5598 024d2ca3 8b9f307c 741c180e 9fc30c62'
device_token = device_token.gsub(" ", "")
the_byte_token = [device_token].pack("H*")
file = File.open("ruby_the_byte_token", "wb")
@vjt
vjt / awesome-nginx.conf
Created January 31, 2011 19:43
*AWESOME* nginx configuration for Ruby/Rack web applications
#
# mmm m m mmm mmm mmm mmmmm mmm
# " # "m m m" #" # # " #" "# # # # #" #
# m"""# #m#m# #"""" """m # # # # # #""""
# "mm"# # # "#mm" "mmm" "#m#" # # # "#mm"
#
# nginx configuration For Ruby/Rack web applications
#
# Cooked up with style, care and a bit of *secret*
# nerdy spice. :-)