Skip to content

Instantly share code, notes, and snippets.

@onjiro
onjiro / splitvideo.rb
Created June 10, 2011 14:44
Split ogv video with mplayer and mencoder.
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
if ARGV.length < 3
puts "#{$0}: usage: #{$0} src destdir [sec]"
exit
end
# 引数の取得
src,destdir,sec_per_part = ARGV
@onjiro
onjiro / float_left_with_relative.html
Created August 30, 2011 07:01
HTML構造のメモ
<html>
<body>
<div id="wrapper" style="width: 560px; margin: 20px auto">
<div id="header" style="display:block; position:absolute; background:#00aa00; width: 480px">
ヘッダー
</div>
<div id="main" style="display:block; width:560px; background:#aaaaaa;">
<div id="contents" style="float:left; margin: 36px 0; background:#aa0000; width: 480px">
コンテンツ
</div>
@onjiro
onjiro / customize.mayu
Created September 7, 2011 09:43
my yamy setting files
include "109.mayu"
include "emacseditcustom.mayu"
keymap Global
# CapsLock に Ctrl の役割を設定
mod Control += E0英数
key *E0英数 = *LControl
key LControl = E0英数
key C-Space = 半角/全角
@onjiro
onjiro / package.json
Created December 4, 2011 16:06
package.json in [email protected] for node.exe
{
"name": "hamljs",
"description": "Faster / Express compliant Haml implementation",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "git://github.com/visionmedia/haml.js.git"
},
"author": "TJ Holowaychuk <[email protected]> (http://tjholowaychuk.com)",
"main": "./lib/haml",
@onjiro
onjiro / build_and_test_when_modified.sh
Created January 9, 2012 10:50
inotify と notify-send のサンプル
while inotifywait -r -e modify ./src; do cake build; cake test |& tee build.log | if grep "Command failed" $*; then notify-send "Test failed"; fi ;done
@onjiro
onjiro / 画面いっぱいを2画面.html
Created January 17, 2012 04:00
画面いっぱいを2画面に表示するサンプル
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
<!--
* {
margin: 0;
padding: 0;
}
html, body {
@onjiro
onjiro / grep_replace.sh
Created February 7, 2012 05:45
grep して 置換するよー。sed -i が使えればこんな面倒なことはいらないッ・・・!
# 次の置換と同じ。
# grep -lre h1 検索対象ディレクトリ | xargs sed -i 's/h1/h2/g'
grep -lre 'h1' 検索対象ディレクトリ | xargs -n 1 -i sh "cp {} tmp; sed -e 's/h1/h2/g' ./tmp > {}"
@onjiro
onjiro / baloonsample.html
Created February 10, 2012 07:42
吹き出しアニメーション
<html>
<head>
<style type="text/css">
/* アイコンは次のサイトのとか使わせてもらったらそれっぽいかも */
/* http://hail2u.net/blog/webdesign/shirokuro-social-icons-v1.5.html */
body {
z-index: 0;
margin-left: 80px;
margin-top: 80px;
background-color: #aaa;
@onjiro
onjiro / nvminstall.sh
Created February 21, 2012 11:55
nvm install
#!/bin/sh
sudo apt-get install curl
git clone git://github.com/creationix/nvm.git ~/.nvm
. ~/.nvm/nvm.sh
echo ". ~/.nvm/nvm.sh" >> ~/.bashrc
echo "enter node version you want to install..."
read -p "ex.) v0.6.11 > " version
@onjiro
onjiro / installgit.sh
Created February 21, 2012 12:12
git initialize
#!/bin/sh
sudo apt-get install git
alias g=git
echo "alias g=git" >> ~/.bashrc
g config --global user.name onjiro
g config --global user.password [email protected]
g config --global alias.co checkout
g config --global alias.br branch