Skip to content

Instantly share code, notes, and snippets.

@mobp
mobp / export_mdd.py
Created May 7, 2011 03:21
MikuMikuDanceからモーションデータをNewTek-MDDに書き出すMMDBridgeのスクリプト。使い方はこちらへ => http://whatweblog.blogspot.com/2011/05/mmdmdd.html
import os
from struct import pack
def export_mdd(premddpath, mddpath):
if os.path.isfile(premddpath):
pass
if os.path.isfile(mddpath):
pass
pre_mdd = open(premddpath, "r")
fmax = None
@mobp
mobp / gist:517122
Created August 10, 2010 11:38
なまえ付きひきすう風メソッドの例
class Window
def initialize
@default = {
:width => 640,
:height => 480,
:title => "window"
}
end
@mobp
mobp / gist:425879
Created June 4, 2010 20:10
game of life (torus)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
#include <unistd.h>
#define WIDTH 40
#define HEIGHT 20
int grid[HEIGHT][WIDTH];
int new_generation[HEIGHT][WIDTH];
@mobp
mobp / Comp.rb
Created June 1, 2010 22:41
重複ファイルの削除
class Comp
def initialize ext
@file_ext = ext
end
def compare n
len = Dir::glob(self.file_ext).length
if n+1 == len || len == 0
return 0
end
src = open(Dir::glob(self.file_ext)[n])
@mobp
mobp / 一文字読み取りread版.sh
Created March 31, 2010 04:47
標準入力からの一文字読み取り
# -s => サイレントモード
# -n => 読み取る文字数
read -s -n1 var
echo "$var"
@mobp
mobp / linemode_directory_browser.bash
Created March 31, 2010 02:08
line-mode directory browser(unstable)
#!/bin/bash
:<<'#license'
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.