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
(defun rangecheck (rc) | |
(lambda (actual) | |
(let* ((comparator (intern (property rc "Comparator") #.*package*)) | |
(unit (find-def (kid-like 'measurementunitref :in rc))) | |
(test (case comparator | |
(LT '<) | |
(LE '<=) | |
(GT '>) | |
(GE '>=) | |
(EQ '=) |
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
(defmethod asdf:perform :around ((op asdf:compile-op) (component asdf:cl-source-file)) | |
(restart-case (call-next-method) | |
(slime-edit () | |
:report "Edit file which failed to compile." | |
(progn | |
(ed-in-emacs (asdf::component-pathname component)) | |
(abort))))) |
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
./long-running-proc | |
#Ctrl-Z # stops the job | |
bg # starts it running in the background | |
disown %1 # detaches this process from the current shell |
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
ps -ef |grep long-running-proc | |
502 6536 5782 0 21:02 pts/8 00:00:07 long-running-proc | |
kill -s SIGCONT 6536 |
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
# Helper script for anyone that has to review Ken's massive pull requests | |
# | |
# Usage: | |
# 0. Save this file as ~/bin/code-review, make it executable and put it in your $PATH | |
# 1. Use https://gist.github.com/3342247 to get a local copy of the PR | |
# 2. Save this as ~/bin/code-review | |
# 3. $ git checkout pr/foo | |
# 4. $ git diff develop.. --oneline |code-review | |
# |
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
# Script to review code in the order specified by Dougo on where_web. If you | |
# prefer a different order just rearrange the order of "git diffs", and maybe | |
# alter the definition of "ordered_files" if you actually add or remove a step | |
# | |
# It assumes you've checked out a local copy of the pull request and are | |
# comparing that with develop. | |
# | |
BASE=develop | |
HEAD=HEAD |
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
MUM=["mom", "mommy", "mother", "mama"] | |
loop do | |
puts MUM.sample | |
sleep(1) | |
end |
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
(defclass venue (validatable) | |
((zip :col-type string :initarg :zip :accessor zip) | |
(phone :col-type string :initarg :phone :accessor phone) | |
(website :col-type (or db-null string) :initarg :website :accessor website)) | |
(:metaclass pomo:dao-class) | |
(:keys id)) | |
(defvalidators venue () | |
(website (start-with "https://")) | |
(phone (match "(\\d\\d\\d)-\\d\\d\\d-\\d\\d\\d")) |
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
#You Only Leak Once | |
# Install valgrind using one of the following | |
brew install valgrind | |
sudo apt-get install vagrind | |
# make sure valgrind is enabled in your ruby build | |
CONFIGURE_OPTS="--with-valgrind" rbenv install 2.0.0-p0 | |
# control test (should not show any memory leaks) |
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
javascript: (function () { | |
$("label").prepend(function () { | |
if ($("abbr sup", this).length === 0) { | |
var annotation = $("<sup>", { "text": $(this).attr("for"), | |
"style": "color: red" }); | |
return $("<abbr>").append(annotation); | |
} | |
}) | |
})(); |
OlderNewer