Skip to content

Instantly share code, notes, and snippets.

@catatsuy
catatsuy / .tmux.conf
Created November 13, 2012 12:09
Basic tmux config
# Prefix
set-option -g prefix C-z
# 日本語環境なら必須??
setw -g utf8 on
set -g status-utf8 on
# status
set -g status-interval 10
set -g status-bg colour100
@catatsuy
catatsuy / presenters.pl
Created November 20, 2012 16:08
プレゼンする人を決める Perl スクリプト
use strict;
use warnings;
use utf8;
use IO::File;
use Text::CSV_XS;
use List::Util qw/shuffle/;
binmode STDOUT, ':utf8';
@catatsuy
catatsuy / musume.pl
Created January 4, 2013 15:40
This is a sample of Acme::MorningMusume
use strict;
use warnings;
use utf8;
use FindBin::libs;
use Acme::MorningMusume;
my $musume = Acme::MorningMusume->new;
my @active_members = $musume->members('active');
use strict;
use warnings;
use utf8;
use Acme::MorningMusume;
my $musume = Acme::MorningMusume->new;
my @active_members = $musume->members('active');
my @sorted_by_birthday = $musume->sort('birthday', 0, @active_members);
@catatsuy
catatsuy / fd_bytes.cc
Created April 16, 2013 17:22
from float/double to byte sequence
#include <cstdio>
void dump(unsigned char *p, int n) {
for (int i = n - 1; i >= 0; i--) {
printf("%02x ", p[i]);
}
printf("\n");
}
int main() {
@catatsuy
catatsuy / app_pi.rb
Last active December 16, 2015 11:09
APP_PI = 3.14
app_pis = (3..1000).map { |n| n * Math.sin(Math::PI / n) }
ans = 0
app_pis.each_with_index do |item, n|
if (item - APP_PI).abs < (app_pis[ans] - APP_PI).abs
ans = n
end
@catatsuy
catatsuy / eval.rb
Last active December 16, 2015 14:39
NUMBER_OF_TRIALS = 3
iterators = (0..12).map { |item| 2 ** item }
iterators.each do |item|
`g++ -O2 -Wall -W -static -std=c++0x -D NUM_COUNTER=#{item} main.cc -o arch.out`
sum = 0
NUMBER_OF_TRIALS.times do
\documentclass[a4paper,papersize,12Q]{jsarticle}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage[dvipdfmx]{graphicx}
\usepackage{calc}
% \usepackage[dvipdfmx]{emathP}
% \let\MARU\relax
\setlength{\textheight}{48\baselineskip+\topskip}
@catatsuy
catatsuy / keymap.txt
Created July 2, 2013 15:51
Google 日本語入力と Mozc のキーバインド設定
status key command
Precomposition Eisu ToggleAlphanumericMode
Precomposition F10 ToggleAlphanumericMode
Precomposition Kana ToggleAlphanumericMode
Precomposition Ctrl ; ToggleAlphanumericMode
Precomposition Shift Space InsertAlternateSpace
Precomposition Space InsertSpace
Precomposition Backspace Revert
Composition Backspace Backspace
Composition Ctrl p ConvertToHalfAlphanumeric
dvipdfmx -f ptex-hiragino.map -f otf-hiragino.map