Skip to content

Instantly share code, notes, and snippets.

View exodist's full-sized avatar

Chad Granum exodist

View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
my $foo = "hello\n";
$a = undef;
$b = undef;
EVIL:
$foo = $a if $a;
@exodist
exodist / gist:9538247
Created March 13, 2014 22:18
zsh expansion issue
exodist@Aswan $ setopt PROMPT_SUBST
exodist@Aswan $ function foo() { date +%s }
exodist@Aswan $ export RPROMPT="%{$(foo)%}"
exodist@Aswan $ 1394749035
exodist@Aswan $ 1394749035
exodist@Aswan $ 1394749035
exodist@Aswan $ 1394749035
@exodist
exodist / .zshrc
Created March 19, 2014 16:49
zsh git stuff
BLACK="%{"$'\033[01;30m'"%}"
GREEN="%{"$'\033[01;32m'"%}"
RED="%{"$'\033[01;31m'"%}"
YELLOW="%{"$'\033[01;33m'"%}"
BLUE="%{"$'\033[01;34m'"%}"
BOLD="%{"$'\033[01;39m'"%}"
NORM="%{"$'\033[00m'"%}"
function gstat() {
branchinfo=`git branch 2>/dev/null`
@exodist
exodist / bad_diea
Created July 28, 2014 21:45
Bad idea, thanks Josh
package Test::Calculate;
use strict;
use warnings;
use Data::Dumper;
use base 'Exporter';
use Carp qw/croak/;
our @EXPORT = ('CALCULATE');
@exodist
exodist / Whoa!
Created September 11, 2014 04:40
Whoa!
use strict;
use warnings;
{
package Foo;
sub finish {
$_[0] = undef;
}
@exodist
exodist / fork code
Created September 13, 2014 03:09
fork code
sub use_fork {
require Storable;
my ($r, $w);
pipe($r, $w) || confess "Could not open pipe! $!";
$_[0]->[_USE_FORK] ||= [$r, $w];
return 1;
}
use strict;
use warnings;
BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't';
@INC = '../lib';
}
}
@exodist
exodist / gist:5b0b9b21cfeda4323937
Last active August 29, 2015 14:11
Test::SkipWithout
package Test::SkipWithout;
use strict;
use warnings;
require Test::More;
sub import {
my $class = shift;
my ($module, $version) = @_;
:map <F9> :w<cr>:! PERL5LIB="" /usr/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:imap <F9> <ESC>:w<cr>:! PERL5LIB="" /usr/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:map <F10> :w<cr>:! PERL5LIB="" /opt/plack/perl/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:imap <F10> <ESC>:w<cr>:! PERL5LIB="" /opt/plack/perl/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
function! RunFennecLine()
let cur_line = line(".")
exe "!FENNEC_TEST='" . cur_line . "' prove -v -Ilib -I. -I/home/cgranum/ndn/perl %"
endfunction
<VirtualHost *:443>
ServerName uebernet-plack.testdomain.com
ServerAlias *
ServerAdmin webmaster@uebernet-plack.testdomain.com
DocumentRoot /ndn/web/uebernet
ErrorLog /var/log/apache2/uebernet.https/error.log
CustomLog /var/log/apache2/uebernet.https/access.log combined