Skip to content

Instantly share code, notes, and snippets.

View aidansteele's full-sized avatar
🏠
Working from home

Aidan Steele aidansteele

🏠
Working from home
View GitHub Profile
+ (id)fetchFirst:(BOOL)first managedObjectWithPredicateFormat:(NSString *)format, ... {
va_list args;
va_start(args, format);
return [self fetchFirst:first managedObjectWithPrefetchedKeyPaths:nil predicateFormat:format arguments:args];
va_end(args);
}
+ (id)fetchFirst:(BOOL)first managedObjectWithPrefetchedKeyPaths:(NSArray *)prefetched predicateFormat:(NSString *)format, ... {
va_list args;
va_start(args, format);
@aidansteele
aidansteele / gist:2296782
Created April 4, 2012 00:50
clang-bug-or-pebkac?
/*
$ clang test.m
test.m:24:17: warning: incomplete implementation [-Wincomplete-implementation]
@implementation Test (TestCategory)
^
test.m:24:17: warning: method in protocol not implemented [-Wprotocol]
test.m:17:1: note: method declared here
- (id)testMethod;
^
test.m:21:12: note: required for direct or indirect protocol 'TestProtocol'
99.9
99.9
99.9
99.9
99.9
99.9
99.9
99.9
99.9
99.9
46.85 100.00%
53.1 99.71%
59.15 99.42%
59.75 99.13%
61 98.84%
66.45 98.55%
67.75 98.26%
68.05 97.97%
69.85 97.67%
70.85 97.38%
# Setup sudo to allow no-password sudo for "admin"
groupadd -r admin
usermod -a -G admin vagrant
cp /etc/sudoers /etc/sudoers.orig
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
# Install NFS client
apt-get -y install nfs-common
@aidansteele
aidansteele / quote_generator_main.py
Created September 17, 2012 00:47 — forked from ngopal/quote_generator_main.py
the main program for the quote generator web app example (built with Flask)
from flask import Flask, url_for, render_template, g, redirect
import random
import sqlite3
DATABASE = 'quotes.db'
app = Flask(__name__)
def connect_db():
return sqlite3.connect(DATABASE)
function getSafeID() {
var idLen = 50;
var vResult = '';
var browser1 = navigator.userAgent || '98d879sd7fIUODCOISAUCA9s8d7fs98d7fs98fd7s';
var browser2 = navigator.appVersion || '7sJKSFHKSJFDd98f7sdf98s7df9s8d7f9';
var browser3 = navigator.vendor || 'oa87f98s7df98sd7f98dsfs9e';
var browser4 = navigator.platform || 'gHHpldsf987s0fs0d9fs0fdease';
var hashMe = browser1 + browser2 + browser3 + browser4 + '00000000000000000000000000000000000000000000000000';
require 'cfpropertylist'
raise "#{$0}: Usage: #{$0} SourceSkin.bundle Customisations.bundle TargetSkin.bundle" unless ARGV.count == 3
source, custom, target = ARGV
CONFIG_NAME = "configuration.plist"
def plist_from_path(path)
CFPropertyList.native_types(CFPropertyList::List.new(:file => path).value) if File.exists?(path)
end
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MKMapView", referenced from:
objc-class-ref in Reveal(IBAMKMapViewSerializer.o)
l_OBJC_$_CATEGORY_MKMapView_$_IBASerializer in Reveal(IBAMKMapViewSerializer.o)
"_OBJC_CLASS_$_GLKView", referenced from:
objc-class-ref in Reveal(IBAGLKViewSerializer.o)
l_OBJC_$_CATEGORY_GLKView_$_IBASerializer in Reveal(IBAGLKViewSerializer.o)
"_OBJC_CLASS_$_MKAnnotationView", referenced from:
objc-class-ref in Reveal(IBAMKAnnotationViewSerializer.o)
l_OBJC_$_CATEGORY_MKAnnotationView_$_IBASerializer in Reveal(IBAMKAnnotationViewSerializer.o)
# gem install guard
# gem install guard-shell
# guard - watch the Magic™
guard 'shell', :elixirc_bin => "/usr/local/elixirc" do
watch(/(.+\.ex$)/) { |m| `elixirc #{m[0]}` }
end
guard 'shell', :elixir_bin => "/usr/local/elixir" do
watch(/(.+\.exs)/) { |m| `elixir #{m[0]}` }
end