Skip to content

Instantly share code, notes, and snippets.

View damianesteban's full-sized avatar
🎯
Focusing

Damian Esteban damianesteban

🎯
Focusing
View GitHub Profile
let views = ["v1": v1, "super": self.view]
self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[super]-(<=0)-[v1(50)]", options: .AlignAllCenterY, metrics: nil, views: views))
self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[super]-(<=0)-[v1(100)]", options: .AlignAllCenterX, metrics: nil, views: views))
func passAnyObject(param: AnyObject) {
print(param)
}
class MyClass {}
struct MyStruct {}
let a: Int = 1
let b = 2.0
@damianesteban
damianesteban / DefaultKeyBinding.dict
Created November 12, 2015 19:57
xcode keybindings for emacs emulation
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* To use: copy this file to ~/Library/KeyBindings/
* after that any Cocoa applications you launch will inherit these bindings
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
F#C#ScalaClojurePythonRubyHaskellSQLOCamlCommon LispErlangSmalltalkSchemeEcmascript 5Perl 5
mapSelectmapmapmapcollectmapSelectmapmapcarmapcollect:mapmapmap
filterWherefilterfilterfilterselectfilterWherefilterremove-if-notfilterselect:filterfiltergrep
foldAggregatefoldLeftreducereduceinjectfoldl
@damianesteban
damianesteban / Carthage Instructions.md
Last active August 29, 2015 14:27 — forked from pxlshpr/Carthage Instructions.md
These are the steps required to add and embed a framework into your project using Carthage.
  1. Add the URL of the framework's repo to your Cartfile using one of the following:
  github "ReactiveCocoa/ReactiveCocoa" # GitHub.com
  github "https://enterprise.local/ghe/desktop/git-error-translations" # GitHub Enterprise
  git "https://enterprise.local/desktop/git-error-translations2.git"
  git "/Users/user/foo/bar.git"

…optionally followed by one of the following version specifiers:

------------
Conformances
------------
protocol AbsoluteValuable
Conformances:
Comparable
IntegerLiteralConvertible
SignedNumberType
# Command Line Tools via Xcode
1. Get Xcode from App Store
2. Open Xcode
3. Go to Preferences
4. Downloads > Components > Command Line Tools > Install
# or
xcode-select --install
# Homebrew
@damianesteban
damianesteban / shit_ror_devs_say.txt
Last active August 29, 2015 14:16 — forked from ktheory/shit_ror_devs_say.txt
Shit Ruby on Rails Developers say in 2015.
Did you upgrade to Rails 4.0.4 yet?
I made a rake task for that.
2.1.0 or 2.2.0?
Did you know there's a rake task for that?
We should use Angular.js on this project.
I love the new hash syntax.
Did you upgrade to Rails 4.18 yet?
Did you see my pull request?
I hate the new hash syntax.
Did you upgrade to Rails 4.2.0 yet?
def fib(n)
(0..n).inject([1,0]) { |(a,b), _| [b, a+b] }[0]
end
@damianesteban
damianesteban / index.md
Last active August 29, 2015 14:11 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one