This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data RedditJsonReply a where | |
GoodJsonReply :: FromJSON a => a -> RedditJsonReply a | |
BadJsonReply :: FromJSON a => [Text] -> RedditJsonReply a | |
errors :: RedditJsonReply a -> [Text] | |
errors (BadJsonReply e) = e | |
errors _ = error "Used 'errors' on GoodJsonReply." | |
reply :: RedditJsonReply a -> a | |
reply (GoodJsonReply a) = a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !has('python') | |
echo "Error: Chronos needs vim compiled with python support." | |
finish | |
endif | |
python << EOF | |
import vim | |
import time | |
timerDict = {} | |
statsDict = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! urxvt settings | |
URxvt.urgentOnBell: true | |
URxvt.internalBorder: 0 | |
URxvt.jumpScroll: true | |
URxvt.perl-lib: /usr/lib/urxvt/perl | |
URxvt.perl-ext-common: keysym-list,keyboard-select,selection,default,matcher,searchable-scrollback,url-select,clipboard | |
URxvt.keysym.C-i: perl:url-select:select-next | |
URxvt.keysym.M-Escape: perl:keyboard-select:activate | |
URxvt.keysym.M-s: perl:keyboard-select:search | |
URxvt.keysym.M-c: perl:clipboard:copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int trimString(string &str) { | |
// TODO: Optimize | |
while (1) { | |
if (str.empty()) break; | |
if (str[0] == ' ') str.erase(0, 1); | |
else if (str[0] == '\r') str.erase(0, 1); | |
else if (str[0] == '\n') str.erase(0, 1); | |
else break; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; SeeBorg 0.51 beta settings file | |
; Lines beginning with ; or # are treated as comments | |
; Address of IRC server | |
server = | |
; Server port | |
serverport = 6667 | |
; Bot's nickname | |
nickname = SeeBorg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd BufWritePost *.hs SyntasticCheck | |
let g:syntastic_aggregate_errors = 1 | |
let g:syntastic_auto_loc_list = 1 | |
let g:syntastic_haskell_checkers = ['hdevtools', 'hlint'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Autosave on focus lost | |
autocmd FocusLost * silent! :wa | |
" map leader to comma | |
let mapleader="," | |
" Change split navigation | |
map <C-h> <C-w>h | |
map <C-j> <C-w>j | |
map <C-k> <C-w>k | |
map <C-l> <C-w>l | |
" Always show status bar(airline) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo = ["foo", "FOO", "foO"] | |
foo = map(lambda s: s.lower(), foo) | |
s = set(foo) | |
for e in s: | |
print e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cctype> | |
using namespace std; | |
class Person | |
{ | |
public: | |
Person(char* newName, int newAge) : name(newName), age(newAge) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Always zero elements of any element in the empty list | |
count(_, [], 0). | |
count(E, L, C) :- count(E, L, C, 0). | |
% This means that the count of the empty list is simply whatever | |
% is in the accumulator when the list is empty. | |
count(_, [], Acc, Acc). | |
count(E, [X|L], C, Acc) :- count(E, L, C, Acc). | |
count(X, [X|L], C, Acc) :- | |
Y is Acc + 1, count(X, L, C, Y). |
OlderNewer