Skip to content

Instantly share code, notes, and snippets.

View shiwano's full-sized avatar
💭
😇

Shogo Iwano shiwano

💭
😇
View GitHub Profile
@shiwano
shiwano / controller.coffee
Created March 11, 2014 14:10
Titanium サンプル
Globals = Alloy.Globals
SceneController = require 'common/controllers/scene'
class exports.Controller extends SceneController
name: Globals.Consts.Scenes.Start
events:
'click startButton': 'moveToHome'
'click optionButton': 'moveToOption'
initialize: ->
@shiwano
shiwano / misakura.rb
Last active August 29, 2015 13:57
misakura's formula for HomeBrew
require 'formula'
class Misakura < Formula
homepage 'https://github.com/shiwano/misakura'
url "https://github.com/shiwano/misakura/archive/v0.1.1.tar.gz"
sha1 "279035a33ca149815fab153222470c9621d7a7ee"
def install
bin.install "misakura"
end
@shiwano
shiwano / commit-msg
Last active August 29, 2015 13:57
commit-msg hook for misakura
#!/bin/sh
if type misakura > /dev/null 2>&1; then
if ! cat $1 | grep '^Before translating into Misakura language:' > /dev/null 2>&1; then
mv $1 $1.$$
misakurized=`cat $1.$$ | misakura`
printf "${misakurized}\n\nBefore translating into Misakura language:\n`sed -e 's/^/\t/g' $1.$$`" > "$1"
rm -f $1.$$
fi
fi
@shiwano
shiwano / print_encodings.py
Created April 1, 2014 06:18
print_encodings.py
#!/usr/bin/env fontforge -script
import fontforge
font = fontforge.open("enter your font path")
font.selection.all()
for glyph in font.selection.byGlyphs:
print glyph.encoding
@shiwano
shiwano / convert.applescript
Created April 4, 2014 08:57
AppleScript to convert to HTML from XLSX
set theDoc to (path to desktop as text) & "test.xlsx"
set outPath to (path to desktop as text) & "test.html"
tell application "Microsoft Excel"
open file theDoc
tell workbook 1
tell sheet 1
save in outPath as HTML file format
end tell
close without saving
@shiwano
shiwano / file0.txt
Created January 20, 2015 10:28
TypeScript の型定義からコードを自動生成するツールを作った ref: http://qiita.com/shiwano/items/dd769ead84e0da2d349a
interface Product {
/** The unique identifier for a product */
id: integer;
/** Name of the product */
name: string;
/**
@minimum 0
@exclusiveMinimum
*/
price: number;
@shiwano
shiwano / AngleGetter.cs
Created July 15, 2015 10:19
Getting 360 angle between two 3d vectors for Unity3D.
public static class Utility
{
public static float CalculateAngle(Vector3 from, Vector3 to)
{
return Quaternion.FromToRotation(Vector3.up, to - from).eulerAngles.z;
}
}
@shiwano
shiwano / openssl_sha256.sh
Created January 24, 2016 06:04
openssl_sha256.sh
openssl dgst -sha256 pkg/dist/master_darwin_amd64
@shiwano
shiwano / UnityPath.mel
Created May 13, 2016 00:15
UnityPath.mel
optionVar -remove "UnityPath";
optionVar -sv "UnityPath" "/Applications/Unity/Unity.app";