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
protocol Convertible { | |
func to<T>() -> T; | |
// var <T>to: T { get } // multiple instances of generic var is not allowed | |
} | |
extension String { | |
func to() -> String { | |
return 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
#include <stdio.h> | |
typedef struct { | |
char her; | |
long double hear[16]; | |
int hero; | |
float yo[17]; | |
} A; | |
#pragma pack(1) |
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 Foundation | |
public protocol JSONEncodable { | |
var json: [String : AnyObject] { get } | |
var Name: String { get } | |
} | |
public protocol JSONDecodable { | |
init?(json: [String : AnyObject]) | |
} |
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
https://mail.haskell.org/pipermail/haskell-cafe/2011-August/094533.html | |
Ivan Tomac ivan.tomac at gmail.com | |
Wed Aug 10 13:26:20 CEST 2011 | |
--------------------------------------------------------------------- | |
I've recently been playing with Sebastian Fischer's explicit sharing | |
monad library (found at http://sebfisch.github.com/explicit-sharing) | |
and after looking at the code noticed the implementation memoizes |
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 sh | |
# put this script in rpath/build, so .xcodeproj is one level up | |
# path to .swift files is supposed to be the same as the project name | |
ROOT=.. | |
MODULE=$(find $ROOT -maxdepth 1 -name '*xcodeproj' -exec sh -c "echo \$(basename {} .xcodeproj)" \;) | |
SOURCES=$ROOT/$MODULE/*swift | |
OBJECTS=./*\.o | |
SDK=$(xcrun --show-sdk-path --sdk iphoneos) |
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
#!/bin/sh | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
if ! [ -z "$1" ]; then | |
sudo rm -rf /Library/Developer/CoreSimulator/ | |
fi |
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
#!/bin/bash | |
lurl=$(pbpaste) | |
login="" | |
key="" | |
regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' | |
if [[ $lurl =~ $regex ]] | |
then | |
echo $lurl | |
else |
I hereby claim:
- I am cfr on github.
- I am cfr (https://keybase.io/cfr) on keybase.
- I have a public key whose fingerprint is 5373 805B 626B E356 E6AD D788 B678 EC84 92B3 C513
To claim this, I am signing this object:
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
// | |
// MyViewController.swift | |
// TypedTableViewControllers | |
// | |
// Created Chris Eidhof on 23/03/15. | |
// Edited by Stan Serebryakov on 25/03/15. | |
// | |
func undefined() { fatalError("undefined") } |