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 File::Temp qw/ tempfile /; | |
use File::Spec; | |
sub usage { | |
"Usage: $0 INPUT_FILE... OUTPUT_FILE" | |
} | |
my $ffmpeg = `which ffmpeg` || `which ffmpeg.exe` or die "Can't find ffmpeg\n\n@{[ usage ]}"; |
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
package main | |
import ( | |
"testing" | |
) | |
const ARRAY_SIZE = 100000 | |
func mkArray() []int { | |
arr := make([]int, ARRAY_SIZE) |
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
@echo off | |
REM VisualStudioの環境変数を設定する | |
call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 | |
REM CygwinコンソールでWindows式のファイルパスを使ったときに警告を出さない | |
set CYGWIN=nodosfilewarning | |
C: | |
chdir C:\cygwin\bin |
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
package regexp | |
import "testing" | |
func TestCompile(t *testing.T) { | |
// 正規表現パターンをコンパイルする | |
re, err := Compile("^[0-9]+$") | |
if err != nil { | |
// コンパイルに失敗した場合はテスト失敗 | |
t.Errorf("Compile failed: %v", err) |
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/zsh | |
if which zsh; then | |
chsh -s `which zsh` | |
else | |
echo "Run this script on Zsh!" | |
exit 1 | |
fi | |
# Install zprezto |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"math" | |
"math/rand" | |
"os" | |
"time" |
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 File::Temp qw/ tempfile /; | |
use File::Spec; | |
sub usage { | |
"Usage: $0 INPUT_FILE... OUTPUT_FILE" | |
} | |
my $ffmpeg = `which ffmpeg` || `which ffmpeg.exe` or die "Can't find ffmpeg\n\n@{[ usage ]}"; |
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; | |
our $VERSION = '0.01'; | |
use constant DEBUG => (!!$ENV{DEBUG}); | |
use Getopt::Std; |
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 | |
# | |
# A simple script to reject commit when there is an unstaged changes | |
# or an untracked file. | |
# | |
# To enable this script, copy this into .git/hooks in your working dir. | |
if `git status |grep -q 'Changes not staged for commit:'` | |
then | |
echo '[!!ERROR!!] Threre is a modified but unstaged file!' |
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
-- serialize | |
JSON::XS: 2.3 | |
Data::MessagePack: 0.34 | |
Storable: 2.30 | |
Benchmark: running json, mp, storable for at least 1 CPU seconds... | |
json: 1 wallclock secs ( 1.08 usr + 0.00 sys = 1.08 CPU) @ 12444.44/s (n=13440) | |
mp: 2 wallclock secs ( 1.07 usr + 0.00 sys = 1.07 CPU) @ 11821.50/s (n=12649) | |
storable: 1 wallclock secs ( 1.06 usr + 0.00 sys = 1.06 CPU) @ 14490.57/s (n=15360) | |
Rate mp json storable | |
mp 11821/s -- -5% -18% |
NewerOlder