Skip to content

Instantly share code, notes, and snippets.

View rakusai's full-sized avatar

Isshu Rakusai rakusai

  • Helpfeel Inc.
  • Kyoto, Japan
View GitHub Profile
rewrew
ew
rweewrew
func
rewew
@rakusai
rakusai / gist:abb86105da4352d7ab6a
Created April 28, 2015 10:33
elastic search 検証クエリ
curl -XPUT 'http://localhost:9200/image3/' -d'
{
"settings": {
"index":{
"analysis":{
"tokenizer" : {
"kuromoji" : {
"type" : "kuromoji_tokenizer"
}
},
@rakusai
rakusai / utf8-urlencode-commandline-arg.c++
Created July 3, 2014 14:21
C++でUTF8でURLエンコードされたコマンドライン引数を受け取る方法
ptrdiff_t urldecode(char* dst, const char* src)
{
char* org_dst = dst;
char ch, a, b;
do {
ch = *src++;
if (ch == '%' && isxdigit(a = src[0]) && isxdigit(b = src[1])) {
if (a < 'A') a -= '0';
else if(a < 'a') a -= 'A' - 10;
else a -= 'a' - 10;
@rakusai
rakusai / hist.rb
Created June 17, 2014 10:37
画像が白系かどうかを判定。
require 'RMagick'
NUM_COLORS = 16
HIST_HEIGHT = 200
img = Magick::Image.read('public/upload_images/d1/a5/d1a50562ce7d25930bc5d4b527aec38b.png').first
img = img.quantize(NUM_COLORS, Magick::GRAYColorspace)
#img = img.quantize(NUM_COLORS)
hist = img.color_histogram
type
//
// Enumeration used to specify a .NET framework version
//
TDotNetFramework = (
DotNet_v11_4322, // .NET Framework 1.1
DotNet_v20_50727, // .NET Framework 2.0
DotNet_v30, // .NET Framework 3.0
DotNet_v35, // .NET Framework 3.5
DotNet_v4_Client, // .NET Framework 4.0 Client Profile
#!/bin/sh
django-admin.py makemessages -a
django-admin.py compilemessages
#django-admin.py makemessages -l de
// Many thanks to http://mntone.hateblo.jp/entry/2013/02/13/115632
[Code]
procedure Pin(path: String; targets: Array of String);
var
i,k: integer;
itemName : String;
FSO, folderPath, fileName, shell, folder, folderItem, colVerbs: Variant;
@rakusai
rakusai / firewall.sh
Last active December 14, 2015 17:29
#!/bin/bash
##
# BlueNote Firewall Configuration
##
# ポリシーの決定
/sbin/iptables -P INPUT DROP # 受信はすべて破棄 すべての穴をふさいでから必要なポートを空ける
/sbin/iptables -P OUTPUT ACCEPT #送信はすべて許可
/sbin/iptables -P FORWARD DROP # 通過はすべて破棄
[user]
name = Isshu Rakusai
email = rakusai@kamilabo.jp
[color]
diff = auto
status = auto
branch = auto
interactive = auto
[branch "master"]
remote = origin