This file contains hidden or 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
# Checkout theirs unmerged files and continue rebase | |
git ls-files --unmerged | awk '{ print $4 }' | uniq | xargs git checkout --theirs -- | |
git ls-files --unmerged | awk '{ print $4 }' | uniq | xargs git add -- | |
git rebase --continue |
This file contains hidden or 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
defmodule MyTypespec do | |
defmacro union_type({:"::", _, [name, types]}) when is_list(types) do | |
union = | |
types | |
|> Enum.reverse | |
|> Enum.reduce(fn x, acc -> | |
{:|, [], [x, acc]} | |
end) | |
quote do |
This file contains hidden or 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
<<<REPLACE-TEXT-ALL | |
** | |
* | |
<<<REPLACE-REGEXP-ALL | |
^##### | |
h5. | |
<<<REPLACE-REGEXP-ALL | |
^#### | |
h4. | |
<<<REPLACE-REGEXP-ALL |
This file contains hidden or 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
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wnonnull" | |
... | |
#pragma clang diagnostic pop |
This file contains hidden or 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
#!/bin/bash | |
# This script builds the iOS and Mac openSSL libraries | |
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script | |
# Credits: | |
# https://github.com/st3fan/ios-openssl | |
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |
This file contains hidden or 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 Foundation | |
protocol EndianConvertible { | |
typealias IntegerType | |
init(bigEndian value: IntegerType) | |
init(littleEndian value: IntegerType) | |
var bigEndian: IntegerType { get } | |
var littleEndian: IntegerType { get } |
This file contains hidden or 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 NSInputStream { | |
func read<T : Integer>() -> T? { | |
var buffer : T = 0 | |
let n = withUnsafePointer(&buffer) { (p) in | |
self.read(UnsafePointer<UInt8>(p), maxLength: sizeof(T)) | |
} | |
if n > 0 { |
This file contains hidden or 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 Foundation | |
func find<C : Collection>(source: C, includeElement: (C.GeneratorType.Element) -> Bool) -> C.IndexType? { | |
for i in indices(source) { | |
if includeElement(source[i]) { | |
return i; | |
} | |
} |
This file contains hidden or 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
require 'ffi' | |
require 'llvm/core' | |
require 'llvm/execution_engine' | |
require 'llvm/target' | |
# Start the "engine" before driving | |
# call InitializeNativeTargetAsmPrinter and InitializeNativeTargetAsmParser | |
LLVM::Target.init_native(true) | |
LLVM::C.link_in_mcjit |