This file contains 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 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 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 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 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 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 | |
unset DYLD_LIBRARY_PATH ; unset LD_LIBRARY_PATH | |
mkdir -p ~/.boot2docker | |
if [ ! -f ~/.boot2docker/boot2docker.iso ]; then cp /usr/local/share/boot2docker/boot2docker.iso ~/.boot2docker/ ; fi | |
/usr/local/bin/boot2docker init | |
if /usr/local/bin/boot2docker up; then | |
export DOCKER_HOST=tcp://$(/usr/local/bin/boot2docker ip 2>/dev/null):2376 | |
export DOCKER_CERT_PATH=/Users/maki/.boot2docker/certs/boot2docker-vm | |
export DOCKER_TLS_VERIFY=1 |
This file contains 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" | |
import "flag" | |
import "math/rand" | |
func main() { | |
var opt_no_alpha bool | |
var opt_no_digit bool | |
var opt_no_unsco bool |
This file contains 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 Getopt::Std; | |
$Getopt::Std::STANDARD_HELP_VERSION = 1; | |
sub HELP_MESSAGE { | |
my $fh = shift; | |
print $fh <<HELP; |
This file contains 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 -x | |
mkdir -p /usr/local/bin | |
cd /usr/local/bin | |
curl -L 'https://gist.githubusercontent.com/Maki-Daisuke/377eae4aaeb1110de183/raw/93a0072929084f6959565dc2516ecde34ad79f00/smbopen' > smbopen | |
chmod +x smbopen |
This file contains 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; |
NewerOlder