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
To merge repo history in, define the following shell function: | |
function git-add-repo | |
{ | |
repo="$1" | |
dir="$(echo "$2" | sed 's/\/$//')" | |
pwd="$(pwd)" | |
tmp="$(mktemp -d)" | |
remote="$(echo "$tmp" | sed 's/\///g'| sed 's/\./_/g')" |
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
On the matter of "1 + 1/2 + 1/4 + 1/8..." really is the same as "two" | |
So, let's assign the answer (whatever it is) to x: | |
x = 1+ 1/2 + 1/4 + 1/8 + ... | |
Now let's take away one | |
x - 1 = 1/2 + 1/4 + 1/8 + ... | |
Now let's double both sides | |
2x - 2 = 1 + 1/2 + 1/4 + 1/8 + ... |
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 | |
# Default param values | |
foo=${1:-"The first entry"} | |
bar=${2:-"The second entry"} | |
echo $foo | |
echo $bar | |
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 | |
# Author: Todd Larason <jtl@molehill.org> | |
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $ | |
# use the resources for colors 0-15 - usually more-or-less a | |
# reproduction of the standard ANSI colors, but possibly more | |
# pleasing shades | |
# colors 16-231 are a 6x6x6 color cube | |
for ($red = 0; $red < 6; $red++) { |
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 perl | |
# Lisp-like lists in perl, made entirely out of functions. | |
sub cons { my ($h,$t)=@_; return sub{ $fn=shift;$fn->($h,$t)} } | |
sub head { my $lst=shift; $lst->( sub{ my($h,$t)=@_; return $h} );} | |
sub tail { my $lst=shift; $lst->( sub{ my($h,$t)=@_; return $t} );} | |
sub list { my $thing = shift; if (defined $thing) { return cons($thing, list(@_)) } } | |
sub listmap { | |
my ($fn,$lst)=@_; |
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 (split src fn) | |
(if (null? src) | |
(fn '() '()) | |
(split (cdr src) | |
(lambda (letters numbers) | |
(let ((next (car src))) | |
(if (number? next) | |
(fn letters (cons next numbers)) | |
(fn (cons next letters) numbers))))))) |
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
Original code: | |
$c->{stash}{this} = thing(); | |
$c->{stash}{that} = thing(); | |
$c->{stash}{the_other} = thing(); | |
some_code(); | |
------------------------------------------------------------------------------ | |
Your changes: |
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 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 | |
# Override error checking so we can commit WIP or whatever with | |
# JFDI=1 git commit .... | |
if [ "0$JFDI" -eq 1 ]; then | |
exit 0 | |
fi | |
# Redirect output to stderr. | |
exec 1>&2 |
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 | |
# Clear wallpaper first | |
xsetroot -solid black | |
while [ 1 ] | |
do | |
date | |
# Generate current Earth & Moon images | |
xplanet -body moon -geometry 300x300 -num_times 1 \ |
NewerOlder