Skip to content

Instantly share code, notes, and snippets.

View coryalder's full-sized avatar

Cory Alder coryalder

View GitHub Profile
func traverse(keyPath: [String], dict: Dictionary<String, AnyObject>?) -> AnyObject? {
if dict == nil {
return nil
}
var paths = keyPath
let next = paths.first!
char str[100];
fgets (str, 100, stdin);
NSString *inputString = [[NSString alloc] initWithUTF8String:str];
inputString = [inputString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSLog(@"Input was %@", inputString);
@coryalder
coryalder / gist:0ca6c03fdf29b55498cb
Created January 15, 2015 03:13
adventure game psuedocode
row1 = 0,0 1,0 2,0 3,0
row2 = 0,1 1,1 2,1 3,1
row3 = 0,2 1,2 2,2 3,2
@coryalder
coryalder / AmazonProduct.swift
Last active October 23, 2019 08:47
Amazon Product Advertising API + Alamofire
//
// AmazonProduct.swift
// Requires SHXMLParser for parsing Amazon's XML responses (https://github.com/simhanature/SHXMLParser)
//
// Created by Cory Alder on 2015-01-11.
// Copyright (c) 2015 Davander Mobile Corporation. All rights reserved.
//
// partly inspired by RWMAmazonProductAdvertisingManager
import Alamofire
@coryalder
coryalder / gist:b5405b9abac79013c791
Last active August 29, 2015 14:12
Solving Protocol issue using an abstract class
// Playground - noun: a place where people can play
import UIKit
class MyItem { /* some model properties */ }
protocol ItemViewProtocol: class {
// some protocol methods (e.g. updateWithItem(), etc)
func setupItem(item: MyItem)
init(String)
@coryalder
coryalder / keybase proof
Created March 7, 2014 21:46
keybase proof
### Keybase proof
I hereby claim:
* I am coryalder on github.
* I am ca (https://keybase.io/ca) on keybase.
* I have a public key whose fingerprint is ADB2 34A2 549E BC4B 4EB5 0276 819C 75BF 9A12 6635
To claim this, I am signing this object:
@coryalder
coryalder / .bash_profile
Created May 20, 2013 02:01
wopen, an Xcode project/workspace opening script
function wopen { # via https://gist.github.com/coryalder/5609996
WORKSPACE="${PWD##*/}.xcworkspace"
PROJECT="${PWD##*/}.xcodeproj"
if [ -a $WORKSPACE ]; then
open $WORKSPACE;
elif [ -a $PROJECT ]; then
open $PROJECT;
else
echo "No workspace or project found.";
fi
<table>
<tr><td>hi</td><td>hello</td></tr>
<tr><td>howdy</td><td>hi hi</td></tr>
<tr><td>bye</td><td>goodbye</td></tr>
</table>
@coryalder
coryalder / fb_open_source_ios
Created August 23, 2012 20:10
Open source libraries used in the new Facebook app.
Appirater
AQGridView
AutoHyperlinks
Boost
Chromium
CocoaLumberjack
CoreTextHyperlinkView
EGODatabase
EGOTableViewPullRefresh
HPGrowingTextView
@coryalder
coryalder / textmatesparkle.sh
Created August 14, 2012 04:51
Automatically update to the current version of TextMate
#!/bin/bash
cd ~/textmate
git pull origin
git submodule update
ninja TextMate
: ${NEWTEXTMATEPATH:="$HOME/build/TextMate/Applications/TextMate/TextMate.app"}
if [ -d $NEWTEXTMATEPATH ]; then
rm -rf /Applications/TextMate.app
mv $NEWTEXTMATEPATH /Applications/
fi