Skip to content

Instantly share code, notes, and snippets.

@ikaro1192
ikaro1192 / ccsgit.py
Created December 19, 2020 14:59
CCS †裏† Advent Calendar 2020の20日目の記事ように書いたgitのパーサー
import zlib
import os
import hashlib
def ls_obj():
object_dirs = os.listdir(path='.git/objects')
for object_dir in object_dirs:
if len(object_dir) == 2:
print(object_dir + (os.listdir(path='.git/objects/' + object_dir)[0]))
@ikaro1192
ikaro1192 / manual.md
Created June 1, 2016 17:04
neovimの設定
$ curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
$ chmod 755 installer.sh
$ ./installer.sh ~/.config/nvim/dein
$ cat .config/nvim/init.vim
set showmode
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set-window-option -g mode-keys vi
set -s escape-time 0
#set-window-option -g mode-mouse on
setw -g utf8 on
set -g status-utf8 on
set-option -g status-bg black #base02
set-option -g status-fg yellow #yellow
set-option -g status-attr default
set-option -g status-interval 1
@ikaro1192
ikaro1192 / gist:02aece2e3dbe0a770524
Last active November 7, 2015 06:59
.tmux.confのバックアップ
# japanese
setw -g utf8 on
set -g status-utf8 on
# reload settings
unbind r
bind r source .tmux.conf; display-message "Reload Config"
# mouse settings
set-window-option -g mode-mouse on
@ikaro1192
ikaro1192 / dump.txt
Created September 22, 2013 12:45
ファイル書き込みがうまくいかない...(Windows 8 64bit ,UTF-8で保存 間にnullが入る模様?(下にodでダンプした結果を貼り付けておきます。
$od -tx1z hoge.txt
0000000 74 00 65 00 73 00 74 00 >t.e.s.t.<
0000010
@ikaro1192
ikaro1192 / teian.txt
Last active December 23, 2015 12:09
Kuinについて思いつき
#提案
関数の引数および返り値の推論機能の追加
イメージ↓
func Add(x : auto, y : int) auto
return x + y
end func
#動機
配列に対してアルゴリズムを適応したいという場面は多々存在すると思うが現状
すべての型について書かなくてはいけない。
@ikaro1192
ikaro1192 / tango.txt
Last active December 20, 2015 14:48
簡易単語帳
#!/bin/bash
LineNumber=`cat $1|wc -l`
while :
do
RND=`expr $RANDOM % $LineNumber`
cat list.txt|head -n $RND |tail -n 1|cut -d',' -f1
read Wait
cat list.txt|head -n $RND |tail -n 1|cut -d',' -f2
read Wait
clear
#include "flyweight_load.hpp"
//==============================FlyweightGraph==============================
int turara_soft::function::FlyweightGraph::Load(std::string FileName){
FlyweightGraph &instance=getInstance();
if (instance.GrHwnd.count(FileName)==0){
instance.GrHwnd.insert( std::map<std::string,int>::value_type(FileName,LoadGraph(FileName.c_str())));
}
@ikaro1192
ikaro1192 / SpeedMeasure.hsp
Created July 27, 2012 12:58
HSPで簡単なベンチマークをとるためのマクロ
#uselib "kernel32.dll"
#cfunc GetTickCount "GetTickCount"
//第一パラメータはベンチマーク名(省略可)
//計測したい部分をSpeedMeasureStartとSpeedMeasureEndで囲む
#define SpeedMeasureStart(%1="No Name") %tSpeedMeasure %i=GetTickCount() %c %s1
#define SpeedMeasureEnd %tSpeedMeasure logmes "<計測結果:"+str(%o)+">" %c logmes str(GetTickCount()-%o)+"[ms]"
@ikaro1192
ikaro1192 / .vimrc
Last active October 5, 2015 01:07
vimrcのバックアップ
set showmode
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set number
set title
set clipboard=unnamed,autoselect
syntax on
set incsearch