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
# foreach in bash | |
for file in `echo *` | |
do | |
do_stuff_to $file | |
done |
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
# A tiny DSL implementation for a minimal subset of BASIC in Scala | |
# Via http://www.nabble.com/-scala--ease-of-making-DSLs-in-Scala---nobody-cares-to22450638.html | |
class BasicClass { | |
abstract sealed class BasicLine | |
case class PrintLine(num: Int, s: String) extends BasicLine | |
case class GotoLine(num: Int, to: Int) extends BasicLine | |
val lines = new scala.collection.mutable.HashMap[Int, BasicLine] | |
case class linebuilder(num: Int) { | |
def GOTO(to: Int) = lines(num) = GotoLine(num, to) |
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 script will go through all pools and scrub them one at a time | |
# Via http://aspiringsysadmin.com/blog/2007/06/07/scrub-your-zfs-file-systems-regularly/ | |
# | |
[email protected] | |
ZPOOL=/usr/sbin/zpool | |
TMPFILE=/tmp/scrub.sh.$$.$RANDOM | |
scrub_in_progress() { |
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
# The MIT License | |
# | |
# Copyright (c) 2008 Jared Kuolt | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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 ruby | |
require Dir | |
unless ARGV[0] | |
puts 'Usage: newpost "the post title"' | |
exit(-1) | |
end | |
blog_root = "/Users/jrk/proj/blog" |
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 gr { | |
## If the current working directory is inside of | |
## a git repository, this function will change | |
## it to the git root (ie, the directory that | |
## contains the .git/ directory), and then print | |
## the new directory. | |
git branch > /dev/null 2>&1 || return 1 | |
cd "$(git rev-parse --show-cdup)". | |
pwd |
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 | |
# The CommandLineFu.com is a great web site to exchange knowledge about shell usage and command line | |
# magics. But if that is about command line will be to have a command line interface to access this | |
# knowledge. | |
# The clfu-seach is the usable proof of concept to think seriously on this idea. | |
# via http://www.colivre.coop.br/Aurium/CLFUSearch | |
# This is a Free (as in freedom) Software licenced under the last GPL. |
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
# Define front_finder_window_path to return the POSIX path string to the frontmost Finder window | |
alias front_finder_window_path="osascript -e 'tell application \"Finder\" to get URL of target of front Finder window' | sed 's/file:\\/\\/localhost//g'" | |
# cd to the front Finder window path | |
alias cdf='cd `front_finder_window_path`' | |
# pushd to the front Finder window path | |
alias pushdf='pushd `front_finder_window_path`' | |
alias pushf=pushdf | |
alias pdf=pushdf |
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
<a href="javascript:location.href='https://libproxy.mit.edu/cgi-bin/ezpauth?url='+location.href">MIT proxy</a> |
OlderNewer