Skip to content

Instantly share code, notes, and snippets.

View exodist's full-sized avatar

Chad Granum exodist

View GitHub Profile
Cleaning up build files
Building Hash-StoredIterator
cc -I/home/exodist/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/x86_64-linux/CORE -DXS_VERSION="0.004" -DVERSION="0.004" -fPIC -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o lib/Hash/StoredIterator.o lib/Hash/StoredIterator.c
lib/Hash/StoredIterator.c: In function ‘XS_Hash__StoredIterator_hash_get_iterator’:
lib/Hash/StoredIterator.c:212:2: warning: passing argument 2 of ‘Perl_sv_setpv’ from incompatible pointer type [enabled by default]
In file included from /home/exodist/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/x86_64-linux/CORE/perl.h:5030:0,
from lib/Hash/StoredIterator.xs:2:
/home/exodist/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/x86_64-linux/CORE/proto.h:4154:20: note: expected ‘const char * const’ but argument is of type ‘struct hsi *’
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Hash/StoredIterator/StoredIterator.bs')
cc -shared -O2 -L/usr/local/lib -f
#!/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