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
// Author: Marcus Zarra | |
// Source: http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ | |
#ifdef DEBUG | |
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] | |
#else | |
#define DLog(...) do { } while (0) | |
#ifndef NS_BLOCK_ASSERTIONS | |
#define NS_BLOCK_ASSERTIONS |
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
#!/usr/bin/env bash | |
function search-prelude { | |
local prelude="prelude.maude" | |
for dir ; do | |
for file in "${dir}/${prelude}" "${dir}/maude/${prelude}" "${dir}/lib/maude/${prelude}" ; do | |
if [[ -f "${file}" ]]; then | |
echo -n "$(dirname "${file}")" | |
return 0 | |
fi |
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
#!/usr/bin/env ruby | |
require 'tempfile' | |
opts = Hash[*%w[--tt title | |
--ta artist | |
--tl album | |
--ty year | |
--tc comment |
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/sh | |
# Usage documentation and program description go here, | |
# nicely formatted and laid out to fit 78 columns. | |
# NOTE: The blank line above is the end of the file comment header. | |
# Check command-line options | |
if true; then | |
# Display the file comment header. | |
sed -n '2,/^$/s/^# //p' "$0" |
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
#!/usr/bin/env ruby -w | |
# Usage: ansicolor attr... [-- string...] | |
# Generate ANSI escape sequences. | |
# With string arguments, print them on stdout, | |
# followed by a `clear' escape sequence. | |
begin | |
require 'term/ansicolor' | |
rescue LoadError | |
require 'rubygems' |
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
#!/usr/bin/env python | |
import fileinput, unicodedata | |
def convert_char(char): | |
try: | |
name = unicodedata.name(char) | |
name = name.replace('LATIN SMALL LETTER', 'LATIN LETTER SMALL CAPITAL') | |
return unicodedata.lookup(name) | |
except KeyError: |
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
walk "$@" | | |
sor 'file $file | grep -q Mach-O' | | |
sor 'otool -L $file | grep -q Cellar/readline/6.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
function cdup { | |
local dir=$PWD | |
local target=${*:-.git} | |
until [ -e "$dir/$target" -o "$dir" = "/" ]; do | |
dir="$(dirname "$dir")" | |
done | |
test -e "$dir/$target" && cd "$dir" | |
} | |
function catup { |
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
0 # successful termination 64 # base value for error messages | |
64 # command line usage error | |
65 # data format error | |
66 # cannot open input | |
67 # addressee unknown | |
68 # host name unknown | |
69 # service unavailable | |
70 # internal software error | |
71 # system error (e.g., can't fork) | |
72 # critical OS file missing |
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
Source: <http://enlivend.livejournal.com/36650.html> |