Skip to content

Instantly share code, notes, and snippets.

$ perl installed2cpanfile > cpanfile
$ cpanm --installdeps .
@hirose31
hirose31 / bashrc
Created August 27, 2012 15:19 — forked from riywo/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)/
@hirose31
hirose31 / jsx
Created June 12, 2012 08:53 — forked from ywatase/jsx
_jsx()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
JSX_OPTIONS='\
--add-search-path\
--executable\
--run\
#!/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 );
#!/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;
#!/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'
(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
@hirose31
hirose31 / gist.pl
Created March 26, 2009 06:04 — forked from typester/gist.pl
gistit
#!/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.
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;