Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
if [ $# -gt 0 ]
then DIR="$1"
else DIR="."
fi
if [ -d "$DIR/.hg" ]
then echo hg status "$DIR"
hg status "$DIR"
elif [ -d "$DIR/.svn" ]
use v6;
grammar Simpl {
token xxx { 'x' }
token c { 'c' }
token end { '!' }
token xc { <xxx>*<c> }
token xend { <xxx>*<end> }
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@clsn
clsn / gist:901470
Created April 4, 2011 10:59
voylogo-s.svg first cut
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
@clsn
clsn / gist:977701
Created May 17, 2011 23:57
Trying to filter!
###### XXX.pm:
#!/usr/bin/perl
package XXX;
use Filter::Simple;
FILTER {
s/MXM/#/g;
}
1;
#!/bin/sh
if [ $# -gt 0 ]
then DIR="$1"
else DIR="."
fi
if [ -d "$DIR/.hg" ]
then echo hg status "$DIR"
hg status "$DIR"
elif [ -d "$DIR/.svn" ]
@clsn
clsn / setup.py
Created August 4, 2011 15:17
Setup.py from singularity
# setup.py
from distutils.core import setup
versionnum="0.30"
try:
import py2exe
except ImportError:
try:
import py2app
except ImportError:
@clsn
clsn / recurs.p6
Created November 10, 2011 06:37
Recursing bug in perl6 rakudo
my $counter=0;
sub recur(Int $x) {
my $h;
$h="h" ~ $counter;
$counter++;
my @k=(1,6);
if ($x>0) {
recur($x-1);
@clsn
clsn / .dir_colors
Created February 3, 2012 05:54
Coolest .dir_colors ever
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# Copyright (C) 1996, 1999-2010 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted provided the copyright notice and this notice are preserved.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Possibly useful emacs-lisp to show the colors:
# (font-lock-add-keywords nil '(("38;5;\\([1-9][0-9]+\\)" (1 `(face (:background ,((lambda (c) (let* ((x (- (string-to-int c) 16)) (arr '("00" "5f" "87" "af" "d7" "ff")) (blue (mod x 6)) (green (mod (/ x 6) 6)) (red (mod (/ x 36) 6))) (if (> x 215) (let* ((z (- x 216)) (s (nth z '("08" "12" "1c" "26" "30" "3a" "44" "4e" "58" "62" "6c" "76" "80" "8a" "94" "9e" "a8" "b2" "bc" "c6" "d0" "da" "e4" "ee" "ff")))) (concat "#" s s s)) (concat "#" (nth red arr) (nth green arr) (nth blue arr))))) (match-stri
@clsn
clsn / gist:3379853
Created August 17, 2012 15:24
gdb mystery...
[mark@dev ~]$ cat A.c
#include <string.h>
int
main() {
}
[mark@dev ~]$ cc -g -c -o A32.o A.c
[mark@dev ~]$ cc -g -c -o A64.o +DD64 A.c
[mark@dev ~]$ cc -g -o A32 A32.o
[mark@dev ~]$ cc -g -o A64 +DD64 A64.o
[mark@dev ~]$ gdb ./A32