Skip to content

Instantly share code, notes, and snippets.

View Code-Hex's full-sized avatar
:shipit:
Go Travel

Kei Kamikawa Code-Hex

:shipit:
Go Travel
View GitHub Profile
@Code-Hex
Code-Hex / hello_world.ll
Last active February 20, 2018 06:57
Compiler::CodeGenerator::LLVM で生成した WebAssembly 向けの LLVM IR とそれから生成した wast
; ModuleID = 'LLVMIR'
source_filename = "LLVMIR"
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown-elf"
%union.UnionType = type { double }
%struct._Hash = type { i32, %union.UnionType*, %struct._String**, i32 }
%struct._String = type { i32, i8*, i32, i32 }
%struct._Object = type { i32, %union.UnionType, i8*, i8*, i8*, i8*, i8*, i8* }
%struct._IO_FILE = type opaque
@Code-Hex
Code-Hex / csv.pl
Last active November 9, 2017 13:12
Maybe easy to get csv data??
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use feature qw/say/;
use Text::CSV;
my $csvfile = 'hello.csv';
my $csv = Text::CSV->new({ binary => 1 }) or die "Cannot use CSV: ".Text::CSV->error_diag();
@Code-Hex
Code-Hex / calc.p6
Created October 21, 2017 14:52
Perl6 で計算機
#use Grammar::Debugger;
#use Grammar::Tracer;
use MONKEY-SEE-NO-EVAL;
grammar Calc::Grammar {
rule TOP { ^ <expr> $ }
rule expr { [ <term> <op> <expr> | <term> ] }
rule term { [ <group> | <number> ] }
@Code-Hex
Code-Hex / docker-compose.yml
Created July 25, 2017 02:00
docker-compose.yml for gogs
version: '2'
services:
postgresql:
restart: always
image: sameersbn/postgresql:9.6-2
volumes:
- /srv/docker/gitlab/postgresql:/var/lib/postgresql:Z
environment:
- DB_USER=gogs
@Code-Hex
Code-Hex / research.md
Last active September 9, 2023 15:08
Research performance nginx per configuration

wrk -c 100 -t 4 -d 10 http://127.0.0.1:8080/

Default configuration

nginx.conf

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;
@Code-Hex
Code-Hex / Makefile
Last active June 27, 2017 00:34 — forked from saboyutaka/Makefile
.DEFAULT_GOAL := help
config: ## copy configs from repository to conf
@sudo cp ~/$HOME/webapp/conf/nginx/nginx.conf /etc/nginx/
@sudo cp ~/$HOME/webapp/conf/nginx/isucon.conf /etc/nginx/conf.d/
@sudo cp ~/$HOME/webapp/conf/mysql/my.cnf /etc/mysql/
@make -s nginx-restart
@make -s mysql-restart
@make -s go-restart
@Code-Hex
Code-Hex / cabocha_install.sh
Last active June 8, 2017 09:42
cabocha_install.sh
#!/bin/bash
base_dir=`pwd`
export PATH=/usr/local/bin:$PATH
wget -O CRF++-0.58.tar.gz "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7QVR6VXJ5dWExSTQ"
tar xzvf CRF++-0.58.tar.gz
cd CRF++-0.58
./configure
@Code-Hex
Code-Hex / cabocha-download.pl
Last active June 7, 2017 02:31
cabocha download script for Travis-ci
#!/usr/bin/perl
# Stolen from https://github.com/Nanolx/patchimage/blob/master/tools/gdown.pl
use strict;
use warnings;
sub execute_command();
my $confirm;
my $check = 0;
my $URL = "https://drive.google.com/uc?id=0B4y35FiV1wh7SDd1Q1dUQkZQaUU&export=download";
@Code-Hex
Code-Hex / bulk.pl
Created April 6, 2017 01:51
Bulk insert 用のクエリ作るくん
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
use Data::Dumper;
my $max_count = 2;
my $columns = [qw/fuji taka nasubi and okinawa/];
my $table = 'tokyo_no_dream';
@Code-Hex
Code-Hex / dump.pl
Created March 24, 2017 14:13
Devel::Peek を使った一覧
use strict;
use warnings;
use v5.10;
use Devel::Peek 'Dump';
sub check($&);
check '$val = 0' => sub {
my $val = 0;