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 | |
#|-*- mode:lisp -*-|# | |
#| <Put a one-line description here> | |
exec ros -Q -- $0 "$@" | |
|# | |
(progn ;;init forms | |
(ros:ensure-asdf) | |
#+quicklisp (ql:quickload '(:lem-base :lem-lisp-syntax) :silent t) | |
) |
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
(in-package :shelly) | |
(export (defvar *argv* nil)) | |
(in-package :cl-user) | |
(defun script (file argv) | |
"Execute a file as script ignoring shebang" | |
(setf shelly:*argv* argv) | |
(let* ((in (open file :if-does-not-exist :error)) | |
(first-char (read-char in)) | |
(second-char (read-char in))) |
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 copy-directory (from to &key overwrite) | |
(let ((len (length (namestring (truename from))))) | |
(cl-fad:walk-directory | |
from | |
(lambda (x) | |
(cl-fad:copy-file | |
x | |
(ensure-directories-exist | |
(merge-pathnames | |
(subseq (namestring x) len) |
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
;;; -*- lexical-binding: t -*- | |
(define-slime-contrib slime-documentation-search | |
"Hand off a documenation search to a web site." | |
(:authors "Ben Hyde <bhyde@pobox.com>") | |
(:license "GPL") | |
(:on-load | |
(define-key slime-doc-map "\C-s" 'slime-documention-search) | |
(define-key slime-doc-map "s" 'slime-documention-search))) |
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
package DBIx::Lite::ResultSet::Role::Slave; | |
use strict; | |
use warnings; | |
use Role::Tiny; | |
around $_ => sub { | |
my ($ORIG, $self, @args) = @_; | |
local $self->{dbix_lite} = $self->{dbix_lite}->master; | |
return $self->$ORIG(@args); | |
} for qw( |
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
// Router: a router that can be combined with jquery.pjax.js [1] | |
// | |
// [1] https://github.com/defunkt/jquery-pjax | |
// | |
// This file is in the public domain. | |
// | |
// | |
// var router = new Router(); | |
// $(document).on('pjax:end', function () { router.dispatch(location); }); | |
// $(function () { router.dispatch(location); }); |
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
use strict; | |
use warnings; | |
use PadWalker qw(peek_my); | |
use Scalar::Util qw(blessed); | |
use Class::Load qw(is_class_loaded); | |
sub UNIVERSAL::the { | |
my $class = shift; | |
my $vars = peek_my(1); | |
my @the = grep { blessed $_ && is_class_loaded($class) ? $_->isa($class) : ref $_ eq $class } map { $$_ } values %$vars; |
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
// copy from https://gist.github.com/1203094 | |
// gcc -o dict -Wall -fobjc-gc -O2 -std=c99 dict.m -framework carbon -framework cocoa | |
#import <Cocoa/Cocoa.h> | |
#import <CoreServices/CoreServices.h> | |
int main(int argc, char *argv[]) | |
{ | |
NSString *word; | |
NSString *result; |