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
#!/usr/bin/env ruby | |
########################################################################### | |
# Script to be called as an Xcode 4 behaviour which will attempt to | |
# uncrustify all source files in the open project. | |
# | |
# (c) Copyright 2012 David Wagner. | |
# | |
# Complain/commend: http://noiseandheat.com/ | |
# | |
#*************************************************************************# |
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
#!/usr/bin/env bash | |
# | |
# Copyright (c) 2012 Jonathan Penn (http://cocoamanifest.net) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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
#define STRUNG_ENUM(THE_ARGS...) STRUNG_SOMETHING(NS_ENUM, THE_ARGS) | |
#define STRUNG_OPTIONS(THE_ARGS...) STRUNG_SOMETHING(NS_OPTIONS, THE_ARGS) | |
#define STRUNG_SOMETHING(TARGET_NS_MACRO, ENUM_BASE_TYPE, ENUM_NULL_VALUE, ENUM_NAME, ENUM_VALUES...) typedef TARGET_NS_MACRO (ENUM_BASE_TYPE, ENUM_NAME) { \ | |
ENUM_VALUES \ | |
}; \ | |
\ | |
\ | |
\ | |
static NSString * ENUM_NAME ## ToDebugString(int enumValue) { \ |
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
struct Tree<A> { | |
let val: A | |
let left: @autoclosure () -> Tree<A> | |
let right: @autoclosure () -> Tree<A> | |
} | |
struct Stream<A> { | |
let val: A | |
let next: @autoclosure () -> Stream<A> | |
} |
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
set current_document_path to "" | |
tell application "Xcode" | |
set last_word_in_main_window to ".swift" | |
if (last_word_in_main_window is "Edited") then | |
display notification "Please save the current document and try again" | |
-- eventually we could automatically save the document when this becomes annoying | |
else | |
set current_document to document 1 whose name ends with last_word_in_main_window | |
set current_document_path to path of current_document |
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
extension Slice { | |
func zipWithTail() -> Zip2<Slice<T>, Slice<T>> { | |
return Zip2(self, dropFirst(self)) | |
} | |
} | |
extension Array { | |
func zipWithTail() -> Zip2<[T], Slice<T>> { | |
return Zip2(self, dropFirst(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
// | |
// NUIBezierPath.h | |
// NUIKit | |
// | |
// Created by Robert Widmann on 10/11/13. | |
// Copyright (c) 2013 CodaFi. All rights reserved. | |
// Released under the MIT license. | |
// | |
#import <Foundation/Foundation.h> |
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
// | |
// Set.swift | |
// TonalKit | |
// | |
// Created by TJ Usiyan on 3/2/15. | |
// Copyright (c) 2015 buttons-and-lights. All rights reserved. | |
// https://gist.github.com/17d2f63780e9549a3335.git | |
import Foundation |
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
// | |
// Optional.swift | |
// TonalKit | |
// | |
// Created by TJ Usiyan on 11/4/14. | |
// Copyright (c) 2014 Buttons and Lights LLC. All rights reserved. | |
// https://gist.github.com/d9d826ed242b89ff2d85.git | |
extension Optional { |
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
// | |
// Array.swift | |
// TonalKit | |
// | |
// Created by TJ Usiyan on 11/8/14. | |
// Copyright (c) 2014 Buttons and Lights LLC. All rights reserved. | |
// https://gist.github.com/7a9444caf1b225070b88.git | |
public func reduceR<S : CollectionType, U, IndexType : BidirectionalIndexType where S.Index == IndexType>(sequence: S, initial: U, combine: (U, S.Generator.Element) -> U) -> U{ |
OlderNewer