This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $grep_opt = "--color=auto"; | |
if ($ARGV[0] =~ /^\-/) { | |
unless ($ARGV[2]) { | |
system("grep $grep_opt $ARGV[0] $ARGV[1] *"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use FindBin; | |
sub get_full_path { | |
return $FindBin::Bin . '/' . $FindBin::Script; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
platex $1 | |
dvipdfmx $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Cwd; | |
use File::Basename; | |
sub get_full_path { | |
my ($filename, $dir_path) = File::Basename::fileparse $0; | |
my $current_path = Cwd::getcwd(); | |
$dir_path =~ s!^$current_path!!; | |
$dir_path =~ s!^\.?/!!; | |
return $current_path . '/' . $dir_path . $filename; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"vim:set ts=8 sts=2 sw=2 tw=0: | |
"---------------------------------------------------------------------------- | |
"Vundle | |
" | |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Alias | |
git config --global alias.br 'branch' | |
git config --global alias.ci 'commit' | |
git config --global alias.co 'checkout' | |
git config --global alias.di 'diff' | |
git config --global alias.dw 'diff --word-diff' | |
git config --global alias.l 'log --decorate' | |
git config --global alias.mg 'merge' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @list = (1,2,3,4,5,6,7,8,9,10); | |
foreach my $elem (@list) { | |
sleep(1); | |
print $elem; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private shouldAssertionError(Closure c) { | |
try { | |
c.call(); | |
fail ("Error"); | |
} catch (AssertionError expected) { | |
assert true; // Successful | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Sample { | |
private boolean isActive; | |
private boolean hoge; | |
private boolean fuga; | |
public final void foo() throws IllegalAccessException, NullPointerException { | |
if (!this.isActive) { | |
throw new AssertionError(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.util.GroovyTestCase | |
public class Test extends GroovyTestCase { | |
private shouldError(Closure c) { | |
try { | |
c.call() | |
assert false // Failure | |
} catch (Error expected) { | |
assert true //Successful |