Skip to content

Instantly share code, notes, and snippets.

View installed2cpanfile
$ perl installed2cpanfile > cpanfile
$ cpanm --installdeps .
View bashrc
#!/bin/bash
if type -p readlink >/dev/null; then
alias abspath='readlink -f'
else
abspath() {
_CWD=$(pwd)
if [ -d "$1" ]; then
\cd $1
echo $(pwd -P)/
View jsx
_jsx()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
JSX_OPTIONS='\
--add-search-path\
--executable\
--run\
View search_cpan.pl
#!/usr/bin/perl
use strict;
use warnings;
use URI::Escape qw( uri_escape );
use HTTP::Lite;
use URI;
use Web::Scraper;
my $query = $ARGV[0] or die "query required\n";
my $url = 'http://search.cpan.org/search?mode=module&n=100&q=' . uri_escape( $query );
View gist:247251
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark;
use Net::CIDR::Lite;
use Net::IP::Match::XS;
use Net::IP::Match::Bin;
use Net::IP::Match::Regexp;
use Net::Patricia;
View gist:128411
(require 'perl-completion)
;; M-x perl-rename-buffer
(defun perl-rename-buffer ()
(interactive)
(let ((package-name (plcmp-get-current-package-name)))
(when package-name
(rename-buffer package-name t))))
;; (add-hook 'cperl-mode-hook
View eyefi_receiver.rb
#!/usr/bin/ruby
#
# Eye-fi receiver
# -- An imcomplete implementation of Gallery Remote Protocol Server
# by SHIDARA Yoji <dara@shidara.net>
#
# see http://codex.gallery2.org/Gallery_Remote:Protocol
#
require 'fileutils'
require 'sinatra'
@hirose31
hirose31 / gist.pl
Created Mar 26, 2009 — forked from typester/gist.pl
gistit
View gist.pl
#!/usr/bin/env perl
sub usage {
my $mesg = shift;
(my $prog = $0) =~ s!.+/!!;
print "[Error] $mesg\n" if $mesg;
print <<EOUSAGE;
[usage]
$prog [-p|-s] file1 file2 ... : submit specified files.
View dan-the-shell.pl
use strict;
use warnings;
use URI::Escape 'uri_escape';
use LWP::UserAgent;
use JSON 'decode_json';
use Term::ReadLine;
my $ua = LWP::UserAgent->new(agent => "Dan the shell");
&main;exit;