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
#!/usr/bin/env perl | |
# Via: http://erdani.org/code/scpi.html | |
################################################################################ | |
## Copyright (c) 2006 by Andrei Alexandrescu | |
## Permission to use, copy, modify, distribute and sell this software for any | |
## purpose is hereby granted without fee, provided that the above copyright | |
## notice appear in all copies and that both that copyright notice and this | |
## permission notice appear in supporting documentation. | |
## The author makes no representations about the |
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
# Recursive wget with link rewriting to point to local/relative paths | |
wget -rk <url> |
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
-- Sets the style of the current Terminal.app terminal | |
-- via http://blog.omnigroup.com/2007/11/03/terminal-scripting-in-105/ | |
-- v2, Updated for 10.6 (Snow Leopard) | |
on run {MyTTY, MySettingsName} | |
set TTYTab to my find_tab_for_tty(MyTTY) | |
if TTYTab is missing value then | |
return -- Bail if we got confused rather than making it worse | |
end if | |
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 <CoreServices/CoreServices.h> | |
static void callback(ConstFSEventStreamRef streamRef, | |
void *clientCallBackInfo, | |
size_t numEvents, | |
void *eventPaths, | |
const FSEventStreamEventFlags eventFlags[], | |
const FSEventStreamEventId eventIds[]) { | |
exit(0); | |
} |
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
#!/bin/bash | |
# | |
# gitwait - watch file and git commit all changes as they happen | |
# via http://stackoverflow.com/questions/420143/making-git-auto-commit/965274#965274 | |
# | |
while true; do | |
inotifywait -qq -e CLOSE_WRITE ~/.calendar/calendar |
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
# | |
# This is the main Apache HTTP server configuration file. It contains the | |
# configuration directives that give the server its instructions. | |
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information. | |
# In particular, see | |
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> | |
# for a discussion of each configuration directive. | |
# | |
# Do NOT simply read the instructions in here without understanding | |
# what they do. They're here only as hints or reminders. If you are unsure |
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
# Initialize or renew Kerberos tickets. Assumes password for the requested principal is stored in the | |
# keychain, which is now automatically used by Snow Leopard kinit. | |
# This is useful to define globally in your shell profile, for easy use within other scripts and | |
# from the command-line. | |
function ker { | |
kinit -R 2> /dev/null | |
if [[ $? = '0' ]]; then | |
echo "renewed..." | |
klist | |
else |
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
function p12topem { | |
# Convert a p12 certificate export to raw OpenSSL pem format, including | |
# private key and certificate. | |
# via http://www.gridsite.org/wiki/Convert_p12 | |
openssl pkcs12 -in "$1" -nodes -out "$2" | |
# Make it readable only by you: | |
chmod 0400 "$2" | |
} |
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
[github] | |
token = !security 2>&1 >/dev/null find-generic-password -gs "github.token" | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function draw() { | |
var canvas = document.getElementById("canvas"); | |
var ctx = canvas.getContext("2d"); | |
ctx.fillStyle = "black"; | |
ctx.beginPath(); |