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
" Vim Pathogen | |
runtime bundle/vim-pathogen/autoload/pathogen.vim | |
call pathogen#infect() | |
call pathogen#helptags() | |
" General Settings | |
set expandtab | |
set tabstop=4 | |
set shiftwidth=4 | |
set softtabstop=4 |
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
module Helpers | |
def arguments(method:, binding:) | |
method.parameters.inject({}) do |args, (type, name)| | |
args[name] = { | |
type:type, | |
value:binding.eval(name.to_s) | |
} | |
args | |
end | |
end |
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
import Cocoa | |
// My JSON Framework | |
protocol NinoScriptJSON { | |
init(json:String) throws | |
init(any:AnyObject) throws | |
} | |
extension NinoScriptJSON { | |
init(json:String) throws { | |
let data = json.dataUsingEncoding(NSUTF8StringEncoding)! |
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
//: Playground - noun: a place where people can play | |
import Cocoa | |
enum Enum { | |
case SimpleCase | |
case AssociatedValue(String) | |
case AnotherAssociated(Int) | |
} | |
extension Enum { |
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
//: Playground - noun: a place where people can play | |
import Cocoa | |
protocol Emptiable { | |
static var emptyValue: Self { get } | |
} | |
extension Emptiable where Self: Equatable { | |
var nonEmptyValue: Self? { |
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
// | |
// ThrowingUtils.swift | |
// | |
// Created by Cristián Arenas Ulloa on 1/13/17. | |
// WTFPLv2 | |
// | |
import Foundation | |
// Usage example: try maybeValue.unwrapped() |
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
// | |
// ThrowingUtils.swift | |
// | |
// Created by Cristián Arenas Ulloa on 1/13/17. | |
// WTFPLv2 | |
// | |
// Usage example: try maybeValue.unwrapped() | |
extension Optional { | |
func unwrapped() throws -> Wrapped { |
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
// | |
// SignalProducer+D3.swift | |
// | |
// Created by Cristián Arenas Ulloa on 3/23/17. | |
// WTFPLv2 | |
// | |
// This overcomplicated tool fits my use case. | |
// It will probably make a lot of sense to you too if you've ever used D3.js. | |
// There was probably an easier way to do it, | |
// but I'm just learning ReactiveSwift so don't hate me . |
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
defmacro mnesia_test(description, context \\ quote(do: _), do: block) do | |
quote do | |
test unquote(description), unquote(context) do | |
{:aborted, error} = | |
Mnesia.transaction(fn -> | |
unquote(block) | |
Mnesia.abort(:ok) | |
end) | |
case error 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
//: Playground - noun: a place where people can play | |
import UIKit | |
let r = UIView(frame: CGRect( | |
x: 0, | |
y: 0, | |
width: 200, | |
height: 200 | |
)) |
OlderNewer