Skip to content

Instantly share code, notes, and snippets.

View yokawasa's full-sized avatar
:octocat:
debugging

Yoichi Kawasaki yokawasa

:octocat:
debugging
View GitHub Profile
@yanbe
yanbe / wn.py
Created March 14, 2009 12:32
A frontend of WordNet-Ja database file (sqlite3 format) which is available on http://nlpwww.nict.go.jp/wn-ja/
#!/usr/bin/env python2.6
# encoding: utf-8
import sys
import sqlite3
from collections import namedtuple
conn = sqlite3.connect("wnjpn-0.9.db")
Word = namedtuple('Word', 'wordid lang lemma pron pos')
@mala
mala / memcachedos.pl
Created August 13, 2010 11:49
DoS for memcached
#!/usr/local/bin/perl
# DoS tool for memcached
# ulimit -n 15000; perl memcachedos.pl 127.0.0.1 11211 3
# original: http://gist.github.com/522741
# This is Public Domain Software
use strict;
use warnings;
use AnyEvent;
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@ikegami-yukino
ikegami-yukino / nfkc_compare.txt
Created December 30, 2013 19:32
Pythonのunicodedata.normalize('NFKC')で正規化される文字の一覧
# -*- coding: utf-8 -*-
import unicodedata
for unicode_id in xrange(65536):
char = unichr(unicode_id)
normalized_char = unicodedata.normalize('NFKC', char)
if char != normalized_char:
if len(normalized_char) == 1:
print u'[%d] %s -> [%d] %s' % (unicode_id, char, ord(normalized_char), normalized_char)
else:
@revolunet
revolunet / ffmpeg-tips.md
Last active October 6, 2023 17:47
ffmpeg tips

libcaca output from your OSX webcam

ffmpeg -f avfoundation -framerate 30 -s "640x480" -i "0" -c:v rawvideo -pix_fmt rgb24 -f caca -s "640x480" output4.mp4

brew install ffmpeg with options

brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-libcaca

convert to another format, resize withouth quality loss

ffmpeg -i vitrine.mp4 -vf scale=1024:-1 -q:vscale 0 vitrine.avi

@timstclair
timstclair / dynamic_select_test.go
Last active June 9, 2022 07:15
Benchmark aggregating channels vs. reflect.Select
package scratch
import (
"reflect"
"testing"
)
const numProduce = 1000
const numChannels = 100
const expectedResult int64 = numChannels * numProduce * (numProduce - 1) / 2
@sj26
sj26 / LICENSE.md
Last active July 16, 2024 08:45
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@naokirin
naokirin / Dockerコンテナ上のログ集約に関するまとめ.md
Last active August 5, 2023 18:41
Dockerコンテナ上のログ集約に関するまとめ

検討するための情報

Dockerコンテナ上のログを集約する方法

  • コンテナの内部で集約する
    • e.g. fluentd、rsyslog等を各コンテナ内に立てる
    • e.g. 単純にファイルに保存する
  • コンテナの外部で集約する
    • e.g. ホスト側にfluentd、rsyslog等を起動して、各コンテナがマウントしたログファイルをtail等で読む
  • e.g. ホスト側にマウントしてファイルに保存する
@erukiti
erukiti / review.md
Last active March 16, 2024 15:31
Re:VIEWチートシート

Re:VIEWチートシート

いつもいつもいつもRe:VIEWの記法に悩んでぐぐってしまう皆さんへ送るチートシートです。

基本

名称 ルール 概要・備考
段落 1行以上の空行をはさむと別の段落になる HTMLでいうP
見出し =ではじまる行 =の個数で、章・節・項・段という感じで増えます。HTMLで言うH1, H2, H3, H4, H5