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
// | |
// SlingScene.m | |
// | |
// Demonstrates a simple slingshot mechanism. | |
// | |
// Created by Andrew Clissold on 5/3/14. | |
// Copyright (c) 2014 Andrew Clissold. All rights reserved. | |
// | |
/* Contents of SlingScene.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
extension NSUserDefaults { | |
func colorForKey(key: String) -> UIColor? { | |
var color: UIColor? | |
if let colorData = dataForKey(key) { | |
color = NSKeyedUnarchiver.unarchiveObjectWithData(colorData) as? UIColor | |
} | |
return color | |
} |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"math/rand" | |
"runtime" | |
"strconv" | |
"time" | |
) |
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
-=-=-=- Andrew and Skye's Awesome Adventures: -=-=-=- | |
-=-=-=- Question 2: Counterfeit Coin Correctness -=-=-=- | |
Loop invariant: | |
At the beginning of each recursion, the real doubloon is either in pile | |
A, B, or C. | |
Initialization: |
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
# reversebinary.py | |
def main(): | |
'''Reverse numbers in binary. | |
For instance, the binary representation of 13 is 1101, and reversing it | |
gives 1011, which corresponds to the number 11. | |
''' | |
decimal_in = read_input() |
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
div > .vimiumHintMarker { | |
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#eee)); | |
border: 1px solid #ddd; | |
text-shadow: none !important; | |
box-shadow: none; | |
} | |
div > .vimiumHintMarker span { | |
color: #a00; | |
font-weight: bold; |
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 | |
for f in $(ls *.c) | |
do | |
echo $f | |
dir=$(echo $f | sed -e 's/.c//g') | |
mv $f $dir/main.c | |
done |
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
// cc -fobjc-arc -framework Foundation main.m | |
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSLog(@"hello, world"); | |
} | |
return 0; | |
} |
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 | |
import Alamofire // Alamofire/Alamofire | |
import Blocker // aclissold/Blocker | |
Alamofire.request(.GET, "http://httpbin.org/get").responseJSON { | |
(_, _, JSON, _) in | |
if let JSON = JSON as? [String: AnyObject] { | |
println(JSON) | |
} |
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
# Copyright (c) 2012 The Go Authors. All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are | |
# met: | |
# | |
# * Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# * Redistributions in binary form must reproduce the above | |
# copyright notice, this list of conditions and the following disclaimer |
NewerOlder