Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# -*- cperl -*-
use strict;
use HTTP::Proxy qw/:log/;
use Time::HiRes qw/time/;
use HTTP::Proxy::BodyFilter::save;
use File::Path qw/mkpath/;
my $dir = shift @ARGV || die "usage: $0 /path/to/music/dump";
rtsp://a1352.l1857053128.c18570.g.lq.akamaistream.net/D/1352/18570/v0001/reflector:53128
scala> "foo.bar.baz".matches("bar.baz")
res80: Boolean = false
scala> "foo.bar.baz".matches(".*bar.baz.*")
res81: Boolean = true
@maxaf
maxaf / gist:379776
Created April 26, 2010 19:38
Scala oops
Welcome to Scala version 2.8.0.Beta1-prerelease (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_17).
Type in expressions to have them evaluated.
Type :help for more information.
scala> class Foo {
| def bar[T]()(implicit man: Manifest[T]) = { man.erasure.getSimpleName }
| }
defined class Foo
scala> (new Foo).bar[Foo]()
max@upsight:~/len$ for file in *; do echo ${#file} "$file"; done | sort -n
9 spaces in
10 file names
39 are the prime cause of sysadmin suicide
max@upsight:~/len$
target/
reports/
lib_managed/
src_managed/
project/boot/
embedded-repo
logs/
max@wart:~/antirez-redis-1af7888$ uname -a
Linux wart 2.6.33-rc1-00225-gc9f937e #2 Wed Dec 23 17:55:01 UTC 2009 armv5tel GNU/Linux
max@wart:~/antirez-redis-1af7888$ cat /proc/cpuinfo
Processor : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS : 1192.75
Features : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant : 0x2
CPU part : 0x131
>>> typeof("") == "undefined"
false
>>> if ("") { console.log("yes!"); } else { console.log("no"); }
no
/dev/sda:
Model=SAMSUNG, FwRev=VBM1EL1Q, SerialNo=S0ENNEAZ609641
Config={ }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=250069680
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
Welcome to Scala version 2.8.0.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import com.mongodb.casbah.Imports._
import com.mongodb.casbah.Imports._
scala> val conn = MongoConnection() // connect to MongoDB
conn: com.mongodb.casbah.MongoConnection = com.mongodb.casbah.MongoConnection@7440d1b0