# on OSX, using built-in Ruby
$ sudo gem install bundler --pre
# inside your app directory
$ bundle init
| // Make initialization + configuration of mutable classes (such as views) easier. | |
| @warn_unused_result | |
| public func Init<Type>(value : Type, @noescape block: (object: Type) throws -> Void) rethrows -> Type | |
| { | |
| try block(object: value) | |
| return value | |
| } | |
| func example() | |
| { |
| # Auto detect text files and perform LF normalization | |
| * text=auto | |
| # Custom for Visual Studio | |
| *.cs diff=csharp |
| // | |
| // CollectionViewDataSource.swift | |
| // Khan Academy | |
| // | |
| // Created by Andy Matuschak on 10/14/14. | |
| // Copyright (c) 2014 Khan Academy. All rights reserved. | |
| // | |
| import UIKit |
| // | |
| // SnapViewController.m | |
| // DynamicsExample | |
| // | |
| // Created by Bryan Irace on 3/8/14. | |
| // Copyright (c) 2014 Bryan Irace. All rights reserved. | |
| // | |
| #import "SnapViewController.h" |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| class StylusFilter < Rake::Pipeline::Filter | |
| def initialize(&block) | |
| block ||= proc { |input| input.sub(/\.styl$/, '.css') } | |
| super(&block) | |
| end | |
| def generate_output(inputs, output) | |
| inputs.each do |input| | |
| output.write `stylus #{input.fullpath}` |
| require "json" | |
| class HandlebarsFilter < Rake::Pipeline::Filter | |
| def initialize(&block) | |
| block ||= proc { |input| input.sub(/\.handlebars$/, '.js') } | |
| super(&block) | |
| end | |
| def generate_output(inputs, output) | |
| inputs.each do |input| | |
| output.write "return Ember.Handlebars.compile(#{input.read.to_json})" |
| /** | |
| * @license handlebars tmpl 0.1.0 - Alex Sexton, but Handlebars has it's own licensing junk | |
| * | |
| * Available via the MIT or new BSD license. | |
| * see: http://github.com/jrburke/require-cs for details on the plugin this was based off of | |
| */ | |
| /* Yes, deliciously evil. */ | |
| /*jslint evil: true, strict: false, plusplus: false, regexp: false */ | |
| /*global require: false, XMLHttpRequest: false, ActiveXObject: false, |