Skip to content

Instantly share code, notes, and snippets.

@beakr
beakr / gist:2669574
Created May 12, 2012 22:51
Create branch and switch to it at the same time.
$ git checkout -b my-branch # Switch to, and create a branch at the same time.
@beakr
beakr / gist:2688904
Created May 13, 2012 15:21
Custom fonts in Rubymotion
# Rakefile
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'helloapp'
app.fonts = ['consolas.ttf']
end
# Put consolas.ttf in resources/
@beakr
beakr / gist:2689973
Created May 13, 2012 20:03
Set RubyMotion background color.
# Set rubymotion background color to white rather than black
self.view.backgroundColor = UIColor.whiteColor
# - - - - - - - - - - - - - - - - - - -
# $0
# - - - - - - - - - - - - - - - - - - -
@beakr
beakr / gist:2705556
Created May 15, 2012 22:17
Code banner snippet
# - - - - - - - - - - - - - - - - - - -
# $0
# - - - - - - - - - - - - - - - - - - -
DOM = {
commune_view: self,
how_much: UILabel,
what_for: UILabel,
who_paid: UILabel,
who_participated: UILabel,
amount: UITextField,
event: UITextField,
commune_it: UIButton,
paid: PersonList::SelectOne,
Teacup::StyleSheet.new(:IPad) do
style :label,
class: UILabel,
text: "Hai!",
color: UIColor.whiteColor,
left: 100,
width: 200,
height: 50
class HaiViewController < UIViewController
def viewDidLoad
Teacup.style(:label, UILabel.new)
:label.addSubview()
end
end
@beakr
beakr / gist:2724884
Created May 18, 2012 11:54
Teacup final DSL beta
Teacup::StyleSheet.new(:IPad) do
style :label,
left: 300,
top: 200
style :price, like: :label,
text: "$1.99"
end
unrecognized selector sent to instance 0x690ba50
2012-05-18 18:30:45.064 trailer[3594:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Symbol pointSize]: unrecognized selector sent to instance 0x690ba50'
*** First throw call stack:
(0x1568052 0x1bcd0a 0x1569ced 0x14cef00 0x14cece2 0x632b14 0x632c84 0x6328b9 0x6337fe 0x5321b3 0x20e9c17 0x20fc12d 0x201c15d 0x20fbfd2 0x20e9cf1 0x20f0281 0x20e9d17 0x20f3c5c 0x2079fb9 0x207bea6 0x210730c 0x4f24c6 0x4f2bd6 0x501743 0x5021f8 0x4f5aa9 0x199afa9 0x153c1c5 0x14a1022 0x149f90a 0x149edb4 0x149eccb 0x4f22a7 0x4f3a9b 0x25ac 0x2485 0x1)
terminate called throwing an exception