Skip to content

Instantly share code, notes, and snippets.

View tadzik's full-sized avatar
🐴

Tadeusz Sośnierz tadzik

🐴
View GitHub Profile
$ git diff
diff --git a/lib/Shell/Command.pm b/lib/Shell/Command.pm
index c3e87a0..2ca0b61 100644
--- a/lib/Shell/Command.pm
+++ b/lib/Shell/Command.pm
@@ -47,7 +47,7 @@ sub mv(*@args) is export {
sub cp($from as Str, $to as Str, :$r) is export {
if ($from.IO ~~ :d and $r) {
mkdir("$to") if $to.IO !~~ :d;
- for dir($from)».basename -> $item {
$ git diff
diff --git a/t/01-file-find.t b/t/01-file-find.t
index a24fa64..72fa71b 100644
--- a/t/01-file-find.t
+++ b/t/01-file-find.t
@@ -78,7 +78,7 @@ if 0 {
}
sub equals(\a, \b, $name) {
- ok ([&&] a >>~~<< b.map(*.IO)), $name
@tadzik
tadzik / masstest
Created November 19, 2011 18:23
Testing modules on nom
#!/usr/bin/env perl6
use Panda;
use Shell::Command;
my $panda;
{
my $pandadir = %*ENV<HOME> ~ '/.panda';
mkpath $pandadir unless $pandadir.IO ~~ :d;
my $projectsfile = "$pandadir/projects.json";
@tadzik
tadzik / gist:1333004
Created November 2, 2011 06:02
Serve current directory via HTTP
import os
import re
import SimpleHTTPServer
import SocketServer
import sys
port = 8080
if len(sys.argv) == 2:
port = int(sys.argv[1])
elif len(sys.argv) > 2:
@tadzik
tadzik / gist:1191470
Created September 3, 2011 17:06
Stupid mpd log analyzer
use MP3::Tag;
use perl5i::2;
# configuration, sorta
func bywhat($track) {
return $track->album->lc
}
my $descending = 0;
my $howmany = 40;
#####################