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
#!/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 | |
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
#!/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
// 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
#!/bin/bash | |
# Bail out if anything goes wrong | |
set -e | |
# Make sure Homebrew and DocBook are present | |
which -s brew | |
docbook="$(brew --prefix docbook)" | |
test -d "$docbook" |
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
/* | |
* ctrl-f1 | |
* ------- | |
* Query or toggle the "Full Keyboard Access" hotkey, Ctrl-F1 | |
* | |
* make CC=clang CFLAGS="-framework Carbon" ctrl-f1 | |
*/ | |
#include <Carbon/Carbon.h> |
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
// | |
// DebuggingUtilities.h | |
// BreakingIntoGDB | |
// | |
// Created by Alexandre Colucci on 23/08/08. | |
// Source: http://blog.timac.org/?p=190 | |
// | |
#import <Foundation/Foundation.h> | |
#import <ApplicationServices/ApplicationServices.h> |
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
// Technical Q&A QA1361 | |
// Detecting the Debugger | |
// Source: http://developer.apple.com/mac/library/qa/qa2004/qa1361.html | |
#include <assert.h> | |
#include <stdbool.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <sys/sysctl.h> |