Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
for dir in $(find "$1" -maxdepth 1 -type d); do
if [ -d "$dir/.git" ]; then
dirty=$(git -C "$dir" diff --shortstat 2> /dev/null | tail -n 1)
if [[ $dirty != "" ]]; then
@leedo
leedo / i3-window-warp
Created January 31, 2015 21:54
bindsym $mod+j exec i3-window-warp focus left
#!/usr/bin/env perl
use AnyEvent;
use AnyEvent::I3 ":all";
my $i3 = i3();
$i3->connect->recv or die "Error connecting";
my $command = join(" ", @ARGV) or die "need command";
my $cv = AE::cv;
@leedo
leedo / i3-window-warp.pl
Created January 31, 2015 21:29
bindsym $mod+j exec --no-startup-id i3-window-warp left
#!/usr/bin/env perl
use AnyEvent;
use AnyEvent::I3 ":all";
my $i3 = i3();
$i3->connect->recv or die "Error connecting";
my $direction = shift or die "need direction";
my $cv = AE::cv;
@leedo
leedo / gist:d70ea20db96008dbbd24
Last active August 29, 2015 14:05
Update bike on Strava activities
#!/usr/bin/env perl
use v5.20;
use feature 'signatures';
use AnyEvent;
use AnyEvent::HTTP;
use AnyEvent::HTTPD;
use JSON::XS;
use URI;
@leedo
leedo / gist:1732feab61acd7f626c8
Last active August 29, 2015 14:01
echo '¯\_(ツ)_/¯' | perl -CS -MUnicode::UCD=charinfo -MData::Dump=pp -lnE 'say join "\n", map {$_, pp charinfo ord $_} split ""'
¯
{
bidi => "ON",
block => "Latin-1 Supplement",
category => "Sk",
code => "00AF",
combining => 0,
comment => "",
decimal => "",
decomposition => "<compat> 0020 0304",
@leedo
leedo / ride.pl
Created August 28, 2013 01:53
shrink and speed up video from Sony action cam
#!/usr/bin/env perl
use strict;
use warnings;
use List::Util qw{max};
use List::MoreUtils qw{none};
use POSIX qw{ceil};
@ARGV == 2 or die "need video file";
@leedo
leedo / gist:6043998
Last active December 20, 2015 00:48
package Fuhbot::Plugin;
use v5.14;
use warnings;
use mop;
class Fuhbot::PluginClass extends mop::class {
has $commands = [];
has $routes = [];
has $events = [];
sub n (*@flat) {
say "flattened " ~ @flat.elems;
}
multi sub m (*@flat) {
say "flattened " ~ @flat.elems;
}
multi sub m ((Range $range)) {
say "got Range";
> &infix:<+> === &infix:<+>
True
> &infix:<+> !== &infix:<+>
Cannot call 'Numeric'; none of these signatures match:
:(Mu:U \v: Mu *%_)
No registered operation handler for 'locallifetime'
in compile_op (src/stage2/gen/QAST.nqp:230)
in as_jast (src/stage2/gen/QAST.nqp:3517)
in as_jast (src/stage2/gen/QAST.nqp:2794)
in (src/stage2/gen/QAST.nqp:3486)
in compile_all_the_stmts (src/stage2/gen/QAST.nqp:3474)
in as_jast (src/stage2/gen/QAST.nqp:3453)
in as_jast (src/stage2/gen/QAST.nqp:2794)
in (src/stage2/gen/QAST.nqp:3486)
in compile_all_the_stmts (src/stage2/gen/QAST.nqp:3474)