Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# http://furbo.org/2009/03/03/open-sesame/
# quote $1 so it works with spaces in the app name
if [ -z "$1" ]; then
echo "usage: $0 <app> [ Preferences | <document> ]"
else
app=`ls -1td /Users/julien/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/*/"$1".app`
dir=`dirname "$app"`
if [ "$2" = "Preferences" ]; then
# uncrustify config file for objective-c and objective-c++
#
#
# Blank Lines
#
nl_after_func_body = 2
nl_after_func_body_one_liner = 2
nl_func_var_def_blk = 0
#
# Blank Lines
#
nl_after_func_body = 2 # number
# Newline count after single-line function body
nl_after_func_body_one_liner = 2 # number
# Newline count after variable definition block
nl_func_var_def_blk = 0 # number
nl_var_def_blk_end = 0
command regex rd 's/^[[:space:]]*$/po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]/' 's/^(.+)$/po [%1 recursiveDescription]/'
@julienp
julienp / JPTiltShift.h
Created December 18, 2012 11:44
Tiltshift filter for CoreImage Top, center and bottom are floats in [0, 1] and control the gradients used to blend the blurred and original image together. The gradients go from (imageHeight * bottom) to (imageHeight * center) and from (imageHeight * top) to (imageHeight * center). This should probably be changed to take CIVectors in unit space …
#import <CoreImage/CoreImage.h>
@interface JPTiltShift : CIFilter
@property (retain, nonatomic) CIImage *inputImage;
@property (assign, nonatomic) CGFloat inputRadius;
@property (assign, nonatomic) CGFloat inputTop;
@property (assign, nonatomic) CGFloat inputCenter;
@property (assign, nonatomic) CGFloat inputBottom;
2012-11-25 15:48:49.213 Migration[27675:1903] -[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:](1055):
CoreData: Ubiquity: Error: A persistent store which has been previously
added to a coordinator using the iCloud integration options must always
be added to the coordinator with the options present in the options
dictionary. If you wish to use the store without iCloud, migrate the
data from the iCloud store file to a new store file in local storage. file://localhost/var/mobile/Applications/02963CFC-D52A-4005-9555-B5E2377B3ADB/Documents/local.sqlite
This will be a fatal error in a future release.
diff --git a/src/Makefile b/src/Makefile
index 3e6f704..4d78605 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -97,8 +97,7 @@ lib_shared_info_post:
@echo "#############################################"
lib_shared: lib_shared_info_pre $(LOBJS) lib_shared_info_post
- $(CC) -shared -Wl,-soname,$(LIBNAME_MAJOR) $(LOBJS) \
- $(LDFLAGS) $(EXTRALIBS) -o $(LIBNAME_VERSION)
#http://www.bittorrent.com/company/about/developer_challenge
from itertools import combinations
def check_solution(solution):
for (o1, o2, o3) in combinations(solution, 3):
if abs(o1 - o2) == abs(o2 - o3):
return False
return True
print(sum(map(check_solution, combinations(range(40), 9))))
import math
class Item(object):
reforgable_stats = frozenset([
'crit',
'hit',
'exp',
'haste',
'mastery'
])