Skip to content

Instantly share code, notes, and snippets.

for vim_typo in viim vmi bim cim vo, viom; do alias "$vim_typo"='vim'; done
@jasonmay
jasonmay / gist:315277
Created February 26, 2010 01:05
AppleScript to open four iTerms along the center of the screen instead of the corners
tell application "iTerm"
set gap to 4
set mw to 640
set mh to 400
set top_left to (make new terminal)
tell top_left
launch session "Default"
end tell
my $parser = qr{
<logfile:debug.log>
# <debug:run>
(
<.ZoneDirective>?
<[ZoneData]>*
<Zone>?
)+
############################################
#!/usr/bin/env perl6
use JSON::Tiny;
my %opp-dir = (
north => 'south',
south => 'north',
east => 'west',
west => 'east',
up => 'down',
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "0.01";
%IRSSI = (
authors => "Jason May",
contact => 'jason.a.may@gmail.com',
name => 'alertsfile',
description => 'Send all hilight messages to a file for external apps to process',
license => "Public Domain",
url => "http://irssi.org/",
#!/bin/bash
BREWBIN=/Users/jasonmay/.brew/bin
GROWLHOST=$1
(
/usr/bin/ssh "$GROWLHOST" "cat .growl-alerts 2>/dev/null; rm -f .growl-alerts" && echo
) | while read msg
do
sub attr_unpack {
shift if ref($_[0]); # called in object context, ditch the object
my $data = shift;
my ($num, $fg, $bg, $bo, $fa, $st, $ul, $bl, $rv);
$num = unpack ('S', $data);
($fg, $bg, $bo, $fa, $st, $ul, $bl, $rv) = (
$num & 7,
($num >> 4) & 7,
use Foo::Baz;
class Foo {
method hello() { Foo::Baz.new.bop() }
}
@jasonmay
jasonmay / mud-client.pl
Created January 24, 2012 05:29
My (very hacky) 'modal' 'MUD' client
#!/usr/bin/env perl
use strict;
use warnings;
use Term::ReadLine;
use IO::Socket::INET;
# ABSTRACT: A hacky modal 'telnet' client
#
# This is written to replace 'rlwrap telnet foo'
# so I can have my own custom keybindings. At the time
#!/usr/bin/env perl
use strict;
use warnings;
sub return_eval {
return eval { die } or do { die "does not get to here" };
}
return_eval();