Skip to content

Instantly share code, notes, and snippets.

#import <Foundation/Foundation.h>
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
void usage(void) {
NSLog(@"Usage: pulpmill -l|<printer>");
}
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
/*
Copyright 2004,2005,2006 Luigi Auriemma
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
/*
usbdevs - list mounted USB devices & their volume paths on Mac OS X
References:
- http://stackoverflow.com/questions/2459414/osx-how-to-get-a-volume-name-or-bsd-name-from-a-iousbdeviceinterface-or-locati
- http://superuser.com/questions/103755/whats-up-with-stat-on-mac-os-x-darwin-or-filesystems-without-names
- http://stackoverflow.com/questions/1698124/how-to-tell-if-a-given-path-is-mounted-removable-media-in-mac-os-x
- http://developer.apple.com/mac/library/samplecode/VolumeToBSDNode/Introduction/Intro.html
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key></key>
<dict>
<key></key>
<string>noop:</string>
<key>$</key>
<string>moveToEndOfLine:</string>
@atr000
atr000 / urlinfo.pl
Created October 6, 2010 18:50
irssi This script will catch incoming urls, grab their <title> and display.
#!/usr/bin/perl -w
# This script will catch incoming urls, grab their <title> and display. It has
# some rudimentary caching.
# WISHLIST
# * grab and add tags, if provided with original msg
# * equivalence rules - some urls are identical
# (like http://42.pl/u/..._description)
# * configurable output (theme item)
require 'formula'
class Cpansearch <Formula
head 'http://github.com/c9s/cpansearch.git', :using => :git
homepage 'http://github.com/c9s/cpansearch'
# Don't take +x off these files
skip_clean 'bin'
# uses libcurl (system)
@atr000
atr000 / iching.sh
Created October 4, 2010 15:00
iching.sh - random iching cast
#!/bin/bash
# iching.sh
# casts an i ching
# use: ching [number]
# with number looks up that hexagram, otherwise casts
function cast {
l=0
until [ $l == 6 ]
on run {input, parameters}
repeat with n in input
set z to (n as alias)
set n to (info for z)'s name
tell application "Finder" to set P to z's container as alias
set zP to POSIX path of (P as text) & n
try
set the_URL to do shell script "mdls -name kMDItemWhereFroms" & space & zP & space & "|" & space & "grep -o '\"'.*'\"'"
set the_URL to replace_chars(the_URL, "\"", "")
tell application "Finder"
# for `make release' and `make html'
DESTDIR = .
# for `make install'
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
SCRIPTDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/man/man1
INSTALL = install
IPROG =# flags for installing programs (default none)
@atr000
atr000 / authorize.c
Created September 4, 2010 05:57
authorize.c
/*
authorize - Use Mac OS X Authorization Services to request authorization for a
specified right.
Copyright (c) 2002-2003 Occam's Razor. All rights reserved.
See the LICENSE file distributed with this code for restrictions on its use
and further distribution.
Original distribution available at <http://www.occam.com/tools/>.