Skip to content

Instantly share code, notes, and snippets.

View oshow's full-sized avatar

O-Show oshow

View GitHub Profile
@oshow
oshow / parse_vrm.rb
Created July 28, 2018 16:29
parse VRM file
require 'json'
require 'pp'
def parse_glb(f)
magic = f.read(4)
if magic != 'glTF'
raise "magic not found: #{magic}"
end
version = f.read(4).unpack('I').first
@oshow
oshow / test.md
Created September 19, 2014 01:41

テスト

  • これはテストです。
  • gist.ioを試す。
@oshow
oshow / private.xml
Last active December 25, 2015 08:58
My settings for KeyRemap4Macbook. When you type Control_L only, send Enter.
<?xml version="1.0"?>
<root>
<item>
<name>Control_L to Control_L</name>
<appendix>(+ When you type Control_L only, send Enter)</appendix>
<identifier>remap.controlL2controlL_enter_orig</identifier>
<autogen>--KeyOverlaidModifier-- KeyCode::CONTROL_L, KeyCode::CONTROL_L, KeyCode::ENTER</autogen>
</item>
</root>
@oshow
oshow / a.rb
Created May 28, 2013 01:10
writing new gist from GistBox
(1..10).each do |i|
puts i
end
@oshow
oshow / fast-export-and-import.sh
Created February 10, 2012 09:30
uniting two git repositories(rough sketch)
cd ~/my_repo1/
git fast-export --all --signed-tags=strip > ~/my_repository.fi
cd ~/my_repo2/
git fast-import < ~/my_repository.fi
# warning: Not updating refs/heads/master (new tip b3e90632cd34e2f4439ba0e6412c2fae3b7929e3
# does not contain b003578907cd0788e350cb3b69e573f59d6db4b8)
# .....
@oshow
oshow / app2.rb
Created November 16, 2011 09:30
for Rubyist Magazine 0036
# encoding: utf-8
require 'rubygems'
require 'sinatra/base'
require 'sinatra/reloader'
require 'rack/rewrite'
require 'padrino-helpers'
require 'padrino-core'
require 'padrino-cache'
require 'haml'
@oshow
oshow / app.rb
Created November 16, 2011 09:29
for Rubyist Magazine 0036
# encoding: utf-8
require 'rubygems'
require 'sinatra/base'
require 'sinatra/reloader'
require 'rack/rewrite'
require 'haml'
class App < Sinatra::Base
enable :inline_templates
@oshow
oshow / gist:1238206
Created September 23, 2011 19:17
using grep for if condition
if grep -i Error log.txt
then
echo "found error"
fi
@oshow
oshow / gist:890311
Created March 28, 2011 11:27
gitのdiff toolにdocdiffを設定する時の各ファイルの内容
◆docdiff.sh(ラッパー)
#!/bin/sh
[ $# -eq 7 ] && docdiff.rb --tty --digest "$2" "$5"
参考:http://twitter.com/#!/kdmsnr/status/16634034079
◆.gitconfig(の一部)