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
//src | |
var filmToActor = g.Morphism().Out("/film/film/starring").Out("/film/performance/actor") | |
g.V().Has("name", "Casablanca").Save("name", "source").Follow(filmToActor).Tag("target").All() | |
//Output (note the different "source" values in first and remaining records): | |
{ | |
"result": [ | |
{ |
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
enum ProtocolMessage : Printable, Equatable { | |
case Keepalive | |
case Hello(pubkey: NSData, password: String) | |
case Send(encodedMessage: NSData, toPubkey: NSData) | |
case HelloResponse | |
case Message(encodedMessage: NSData, fromPubkey: NSData) | |
var description: String { | |
get { | |
switch 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
== podfiles: 30 == | |
SDWebImage: 11 | |
AFNetworking: 8 | |
RestKit: 8 | |
HockeySDK: 8 | |
BlocksKit: 7 | |
CocoaLumberjack: 6 | |
MBProgressHUD: 6 | |
TTTAttributedLabel: 5 |
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
//@auto_closure hack to prevent `LLVM ERROR: unimplemented IRGen feature! non-fixed multi-payload enum layout` | |
//as in https://github.com/maxpow4h/swiftz/blob/master/swiftz/Either.swift | |
enum Either<L,R> { | |
case Left(@auto_closure () -> L) | |
case Right(@auto_closure () -> R) | |
func flatMapLeft<L1>(f: (L) -> Either<L1, R>) -> Either<L1, R> { | |
switch self { | |
case let .Left(l): return f(l()) | |
case let .Right(r): return .Right(r) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Pay QR</title> | |
<!-- Bootstrap --> | |
<!-- Latest compiled and minified CSS --> |
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
(defn symmetrize-body-parts | |
"Expects a seq of maps which have a :name and :size" | |
[asym-body-parts] | |
(loop [unprocessed-parts asym-body-parts | |
processed-parts nil] | |
(println (str "processed: " processed-parts)) | |
(println (str "unprocessed: " unprocessed-parts)) | |
(if unprocessed-parts | |
(let [[current-part & remaining-parts] unprocessed-parts | |
processed-with-left (conj processed-parts current-part)] |
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
[[[[[[[[[RACAbleWithStart(client, networkReachabilityStatus) | |
filter:^BOOL(NSNumber* statusNumber) { | |
AFNetworkReachabilityStatus status = statusNumber.intValue; | |
BOOL autoLoadOn3G = [[NSUserDefaults standardUserDefaults] boolForKey:KEY_AUTOLOAD_3G]; | |
return (status == AFNetworkReachabilityStatusReachableViaWiFi | |
|| (autoLoadOn3G && status == AFNetworkReachabilityStatusReachableViaWWAN)); | |
}] | |
take:1] | |
flattenMap: ^(id value){ |
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
aaa |
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
UInt16 program[] = { | |
SET | X << 4 | 0x2A << 10, //SET X, 11 | |
ADD | X << 4 | NW << 10, VMEM_DISPLAY_START + 32*6, //ADD x, VMEM + 32 * 6 | |
SET | Y << 4 | 0x2D << 10, //SET Y, :data | |
IFE | MEM_Y << 4 | 0x20 << 10, //IFE [X], 20 | |
SET | PC << 4 | 0x2C << 10, //JMP :loop | |
SET | MEM_X << 4 | MEM_Y << 10, //SET [Y], [X] | |
BOR | MEM_X << 4 | NW << 10, 0x0F00, //BOR [Y], 0x0F00 ; set char color | |
ADD | X << 4 | 0x21 << 10, //ADD X, 1 | |
ADD | Y << 4 | 0x21 << 10, //ADD Y, 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
if (direction == '') { | |
direction = 'east'; | |
} | |
var dirs; | |
var look = function (dir) { | |
if (dir == 'north') return north; | |
else if (dir == 'south') return south; | |
else if (dir == 'east') return east; | |
else if (dir == 'west') return west; | |
} |
NewerOlder