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 | |
use strict; | |
use warnings; | |
if ($<) { | |
print "It's a weird tree.\n"; | |
} else { | |
print <<'EOF'; | |
_ __ | |
/ `\ (~._ ./ ) |
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 | |
yesno() | |
{ | |
echo -ne "$1 [Y/n] " | |
read -r | |
case $REPLY in | |
[yY]) return 0 ;; | |
*) return 1 ;; | |
esac |
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/ruby | |
board = Array.new(8) | |
# Bishops | |
2.times do |i| | |
r = rand(4) * 2 | |
if i == 1 | |
r += 1 |
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 | |
if [ -z "$1" ]; then | |
echo "Usage: $0 [app]" | |
exit | |
fi | |
cache_dir="$XDG_CONFIG_HOME/codeigniter" | |
if [ ! -d $cache_dir ]; then |
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 | |
use strict; | |
use warnings; | |
use File::Copy::Recursive "dircopy"; | |
use Cwd; | |
use autodie; | |
use feature 'say'; | |
my @ABS_DIRS = qw(core extra community multilib); | |
my $BUILD_DIR = "$ENV{HOME}/abs"; |
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 python | |
import math | |
class Vector(tuple): | |
def __add__(self, other): | |
return Vector(x + y for x, y in zip(self, other)) | |
def __sub__(self, other): | |
return Vector(x - y for x, y in zip(self, other)) |
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 | |
use strict; | |
use warnings; | |
use 5.012; | |
use feature qw(switch say); | |
use LWP::Simple; | |
my $url = "http://apps.cs.utexas.edu/unixlabstatus/"; | |
my $html = get $url; |
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
me: | |
@true | |
a: | |
@true | |
sandwich: | |
@if test `whoami` != "root"; \ | |
then \ | |
echo "What? Make it yourself."; \ | |
exit; \ | |
else \ |
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 midpoint (lst) | |
(setq current lst) | |
(setq prev lst) | |
(loop while (and lst (rest lst)) do | |
(setq lst (rest (rest lst))) | |
(setq prev current) | |
(setq current (rest current))) | |
prev) | |
(defun dmerj (x y) |
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
object randomCapitals { | |
def randomUpper(sentence: String) = { | |
sentence.map(c => | |
if (math.random > .5) | |
c.toUpper | |
else | |
c.toLower) | |
} | |
def main(args: Array[String]) { |
OlderNewer