Skip to content

Instantly share code, notes, and snippets.

View jessedc's full-sized avatar

Jesse Collis jessedc

View GitHub Profile
//
// SSMapAnnotation.h
// Public Domain
//
// Created by Sam Soffes on 3/22/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
#import <MapKit/MapKit.h>
$cacheDir = './cache/';
$curl_setopt_array = array( CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true);
if (file_exists($cacheDir.$filename)) {
$timetable_view_file = file_get_contents($cacheDir.$filename);
}else{
$curlR = curl_init($request_url);
if (curl_setopt_array($curlR, $curl_setopt_array)){
$timetable_view_file = curl_exec($curlR);
<?php
class DBObject {
public function getManyMany($class,$where = false,$options = array()){
$table = static::_table();
$join = $class::_table();
if (strnatcmp($table, $join))
$join_table = sprintf('%s_%s', $join, $table);
else
$join_table = sprintf('%s_%s', $table, $join);
@orj
orj / gist:985501
Created May 22, 2011 14:05
A Objective-C macro for generating @synthesize statements. Useful when you want to enforce a specific naming convention on synthesized ivars.
/*!
\def N_ARGS
\brief Macro that can tell how many variable arguments have been passed to it (up to a total of 16).
*/
#define N_ARGS(...) N_ARGS_1(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
#define N_ARGS_1(...) N_ARGS_2(__VA_ARGS__)
#define N_ARGS_2(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, n, ...) n
/*!
\def CAT
@cormacrelf
cormacrelf / Spacedust.tmTheme
Created June 12, 2011 04:43
Spacedust TextMate theme - hand-transferred from Xcode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Spacedust</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@sgleadow
sgleadow / RunPlatformUnitTests.sh
Created April 18, 2012 03:11
Modified shell script to run OCUnit and Kiwi tests on the command line.
#!/bin/sh
##
# Copyright 2008 Apple Inc.
# All rights reserved.
#
# iPhoneSimulator platform
# This script runs all of the unit tests for the target test bundle specified by the passed-in environment.
# This script is generally intended to be invoked by ${DEVELOPER_TOOLS_DIR}/RunUnitTests. The interface or location of this script may change in future releases.
##
#
@tonyarnold
tonyarnold / gist:3162762
Created July 23, 2012 09:20
Git config aliases for markdown release notes
[alias]
co = checkout
tagsbydate = for-each-ref --sort=-taggerdate --format='%(refname:short)' refs/tags
previoustag = !sh -c 'git tagsbydate --count 2 | cut -f2 | sed -n 2p'
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
markdownlog = log --color --pretty=format:'* %s `%Cred%h%Creset` - %C(bold blue)[%an](mailto:%ae)%Creset' --abbrev-commit --dense --no-merges --reverse
releasenotes = !sh -c 'git markdownlog ...`git previoustag`'
@cdata
cdata / xcodeinstaller.sh
Created February 9, 2011 01:02
Snippet for unattended installation of XCode
#!/bin/bash
# This snippet should hypothetically allow a totally unattended
# installation of Apple's XCode. After prompting for credentials,
# the script simulates a login, begins a download and subsequently
# mounts the disk image and installs XCode to the default location.
echo -n "ADC login: "
read login
echo -n "ADC password: "
@jessedc
jessedc / ObsidianCode.dvtcolortheme
Last active April 20, 2016 09:22 — forked from subdigital/ObsidianCode.dvtcolortheme
Obsidian Code Theme for Xcode 4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>