This file contains hidden or 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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <SDL/SDL.h> | |
| int main(void) | |
| { | |
| SDL_Surface *main_surf; | |
| SDL_Event *const ev = malloc(sizeof (SDL_Event)); |
This file contains hidden or 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
| {-# LANGUAGE FlexibleInstances, Rank2Types, TypeFamilies #-} | |
| module ChurchBool where | |
| type CB = forall a. a -> a -> a | |
| instance a ~ Bool => Show (a -> a -> a) where | |
| show cb = if cb True False then "cTrue" else "cFalse" | |
| cTrue, cFalse :: CB |
This file contains hidden or 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
| " Jump backwards or forwards through the jump list one buffer at a time, | |
| " rather than one jump at a time. | |
| " | |
| " Use <Leader>o to jump backwards and <Leader>i to jump forwards | |
| let s:JUMPLIMIT = 100 | |
| if exists('g:loaded_jump_buf') && loaded_jump_buf | |
| finish | |
| endif |
This file contains hidden or 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
| parse_git_branch () { | |
| local stat | |
| if ! stat=`git status -sb 2>/dev/null` || [[ -n $NO_GIT_PROMPT ]]; then | |
| return | |
| fi | |
| local ref=`sed -nr '/^##/{s/^## (Initial commit on )?//;p}' <<<"$stat"` | |
| local dirty=` |
This file contains hidden or 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
| #!/bin/bash | |
| # Print Dungeon Crawl Stone Soup high score list | |
| { | |
| echo ' |Score|Name|Level|Type|Religion|Runes Ascended' | |
| for f in `ls -tr ~/.crawl/morgue/morgue-*.txt`; do | |
| sed -nr ' | |
| 3{ | |
| s/([0-9]+)./\1|/ |
This file contains hidden or 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
| # Common pattern for searching file contents | |
| fxg () { | |
| local OPTIND=1 findbase=. grepflags verbose=false usage=false | |
| while getopts b:g:vh opt; do | |
| case $opt in | |
| b) findbase=$OPTARG ;; | |
| g) grepflags=$OPTARG ;; | |
| v) verbose=true ;; |
This file contains hidden or 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
| #!/bin/bash | |
| ls /var/cache/pacman/pkg | | |
| awk -F - ' | |
| { | |
| k = "" | |
| for (i = 1; i < NF - 2; ++i) | |
| k = k $i "-" | |
| sub(/-$/, "", k) |
This file contains hidden or 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
| #!/bin/bash | |
| # List Arch Linux packages recently added to the system | |
| # | |
| # Usage: | |
| # | |
| # pacweek [<since>] | |
| # | |
| # Default interval is 1 week ago. | |
| # |
This file contains hidden or 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
| import types | |
| from django.core import exceptions | |
| def auto_error_class(field, error_class="error"): | |
| inner_clean = field.clean | |
| def wrap_clean(self, *args, **kwargs): | |
| try: |
This file contains hidden or 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
| #!/bin/bash | |
| branches=$( | |
| git branch --contains ` | |
| git rev-list $1..$2 | | |
| tail -n 1 | |
| ` | | |
| sed 's/^..//' | |
| ) |