Skip to content

Instantly share code, notes, and snippets.

View jjthrash's full-sized avatar

Jimmy Thrasher jjthrash

View GitHub Profile
(page "index.html")
(def multipliers [1 2 4 7 10 15])
(def default-counts [0 0 0 0 0 0])
(defc counts default-counts)
(defc= score (reduce + (map * counts multipliers)))
(defn increment-counter [idx c]
(assoc c idx (inc (get c idx))))
@jjthrash
jjthrash / -
Created December 2, 2014 16:17
diannao:kakoune (11:16) $ lldb kak
(lldb) target create "kak"
Current executable set to 'kak' (x86_64).
(lldb) run
Process 58924 launched: '/usr/local/bin/kak' (x86_64)
Process 58924 stopped
* thread #1: tid = 0x468020, 0x00007fff8b16094a libsystem_kernel.dylib`poll + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff8b16094a libsystem_kernel.dylib`poll + 10
libsystem_kernel.dylib`poll + 10:
-> 0x7fff8b16094a: jae 0x7fff8b160954 ; poll + 20
-- Dumb way (list monad):
combine = do
a <- list1
b <- list2
c <- list3
return [a, b, c]
-- OK way (list monad):
"{{{ stuff specifically for GUI-mode...
if version >= 500
" switch syntax highlighting on when the terminal has colors;
" switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
" on terminal and in gui mode, background is dark...
set background=dark
syntax on
hi Folded guifg=Black guibg=DarkMagenta gui=bold
-- given multi-line input where options are stated per line, spit out all possible options
import System.IO
main = do
input <- getContents
putStrLn $ show $ sequence $ map (words) $ lines input
@jjthrash
jjthrash / allowanimations.diff
Created November 6, 2009 15:45
Allow users of Airship/StoreFront API to specify their own animations
diff --git a/Airship/StoreFront/StoreFront.h b/Airship/StoreFront/StoreFront.h
index 740467a..8433950 100644
--- a/Airship/StoreFront/StoreFront.h
+++ b/Airship/StoreFront/StoreFront.h
@@ -44,6 +44,7 @@
SINGLETON_INTERFACE(StoreFront)
++(UIView*)makeStoreFrontView;
+(void)displayStoreFront;
#!/bin/bash
set -e
if [ -x /usr/local/bin/git ]; then
export GIT=/usr/local/bin/git
elif [ -x /usr/bin/git ]; then
export GIT=/usr/bin/git
else
exit 0
NSLog(@"BUILD VERSION: %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]);
diff --git a/Airship/StoreFront/UAInventory.m b/Airship/StoreFront/UAInventory.m
index 92563d0..9088f85 100644
--- a/Airship/StoreFront/UAInventory.m
+++ b/Airship/StoreFront/UAInventory.m
@@ -55,9 +55,13 @@
return productList;
}
+- (NSArray*)sortedKeys {
+ return [[productList allKeys] sortedArrayUsingSelector:@selector(compare:)];
diff --git a/Airship/StoreFront/StoreFrontDelegate.h b/Airship/StoreFront/StoreFrontDelegate.h
index 98ceb74..5d6c06a 100644
--- a/Airship/StoreFront/StoreFrontDelegate.h
+++ b/Airship/StoreFront/StoreFrontDelegate.h
@@ -32,5 +32,6 @@
@optional
-(void)storeFrontDidHide;
-(void)storeFrontWillHide;
+-(BOOL)shouldDisplayProduct:(UAProduct*)product;