Skip to content

Instantly share code, notes, and snippets.

View shogo82148's full-sized avatar
🏠
Working from home

ICHINOSE Shogo shogo82148

🏠
Working from home
View GitHub Profile
$ make go
Skip building js due to lack of nodejs
Skip building tex due to lack of tex
Skip building cl due to lack of sbcl
sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
Skip building cpp due to lack of g++-6
Skip building i due to lack of ick
cp test/00exit.eir out/00exit.eir.tmp && mv out/00exit.eir.tmp out/00exit.eir
@shogo82148
shogo82148 / qrlist.pl
Created November 24, 2016 08:47
QRコードやフレームQRの型式情報一覧を生成する
use 5.018;
use utf8;
use warnings;
use strict;
my $size = 5;
sub bch5 {
my ($c) = @_;
my $pattern = ((1<<10) | (1<<8) | (1<<5) | (1<<4) | (1<<2) | (1<<1) | (1<<0))<<4;
@shogo82148
shogo82148 / gist:43e7253e745f3ab3f2f1
Created March 4, 2016 00:52
{% trans %} {% endtrans %}
(defun wrap-region-by-string ()
(interactive
(let ((start-point (region-beginning))
(end-point (region-end)))
(save-excursion
(goto-char start-point)
(insert "{% trans %}")
(goto-char (+ end-point (length "{% trans %}")))
(insert "{% endtrans %}")))))
@shogo82148
shogo82148 / README.md
Last active December 15, 2015 03:34
Mackerel辞書

Mackerel辞書

$ ab -r -n 1000000 -c 10 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
@shogo82148
shogo82148 / test.md
Last active November 4, 2015 22:45
test of race-free SIGTERM handling
$ perl -MStarlet\ 999
Starlet version 999 required--this is only version 0.27_01.
BEGIN failed--compilation aborted.

# それぞれのコマンドを別ウインドウで実行
$ start_server --port 5000 --pid app.pid -- plackup -s Starlet --max-workers 20 app.psgi > /dev/null 2>&1
$ while true; do kill -HUP `cat app.pid`; sleep 1; done
$ ab -c 20 -n 100000 -r http://localhost:5000/
@shogo82148
shogo82148 / app.psgi
Last active October 12, 2015 11:40
testing Starlet/Gazelle graceful shutdown
# start_server --port 5000 --pid app.pid -- plackup -s Starlet --max-workers 20 app.psgi > /dev/null 2>&1
# while true; do kill -HUP `cat app.pid`; sleep 1; done
my $app = sub {
my $env = shift;
return [
200,
[ 'Content-Type' => 'text/plain' ],
[ "Hello World" ],
];
@shogo82148
shogo82148 / csv2yaml.go
Last active August 29, 2015 14:17
csv to yaml converter
package main
import (
"encoding/csv"
"io"
"os"
"sort"
"gopkg.in/yaml.v2"
)
@shogo82148
shogo82148 / README.md
Last active August 29, 2015 14:17
golang sync test

Sync!

@shogo82148
shogo82148 / README.md
Last active May 15, 2021 14:14
golang flag test

Flag!