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/sh | |
if [ -z $1 ]; then echo "$0: Please supply a label"; exit 1; fi | |
launchctl list | grep -i "$1" | cut -f1 | grep -ve "^-" | xargs kill |
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
// loadavg.c | |
// Simple load average spewer for BSDs and Mac OS X | |
// tim at utf8.me | |
// (Why is there no system binary for this?) | |
#include <stdlib.h> | |
#include <stdio.h> | |
int main(int argc, char* argv[]) { | |
double loads[3] = {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
#!/usr/bin/perl -w | |
# Convert .Xdefaults or similar terminal colors to iTerm2 scheme | |
# Only supports simple hex colors, no funny stuff | |
use strict; | |
print <<eof; | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
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 | |
baseu="http://www.handbook.unsw.edu.au/vbook2012/brCoursesByAtoZ.jsp?StudyLevel=Undergraduate&descr=" | |
basep="http://www.handbook.unsw.edu.au/vbook2012/brCoursesByAtoZ.jsp?StudyLevel=Postgraduate&descr=" | |
if [[ ! $1 =~ ^[A-Z]{4} ]] || [ $# -eq 0 ]; then | |
echo "Usage: ./$0 TYPE" | |
else | |
baseu+="${1:0:1}" | |
basep+="${1:0:1}" | |
wget -q -O- $baseu $basep | w3m -dump -cols 150 -T "text/html" | grep -e "^$1" | sort | uniq | \ | |
sed -re "s/[ \t]+[0-9]+$//g;s/[ \t]{2,}/ /g" |
NewerOlder