Skip to content

Instantly share code, notes, and snippets.

View mofukuma's full-sized avatar

mofukuma

View GitHub Profile
@mofukuma
mofukuma / nodesh.bat
Created October 14, 2015 03:53
WindowsのバッチをNode.jsで書く雛形
//&cls&node %0&pause > nul&exit /b 0
var cp = require('child_process');
var p = console.log;
function $(a){
r = ""+cp.execSync(a);
p("$ "+a+"\n => "+r);
return r;
}
@mofukuma
mofukuma / coffeesh.bat
Created October 14, 2015 03:52
WindowsのバッチをCoffeeScriptで書く雛形
#&cls&coffee %0&pause > nul&exit /b 0
cp = require('child_process')
p = console.log
$ = (a) ->
r = ""+cp.execSync(a)
p "$ #{a}\n => #{r}"
return r
<a class="twitter-timeline" href="https://twitter.com/search?q=%23%E3%81%8F%E3%81%BE%E3%81%98%E3%82%93" data-widget-id="454428910218784768">Twitterの反応</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@mofukuma
mofukuma / gist:8451171
Last active January 3, 2016 10:39
Jadeでbulletmlを書くとこうなる例
bullet(label='downAccel')
direction 270
speed 2
action
accel
vertical 3
term 120
@mofukuma
mofukuma / trans.html
Created April 11, 2013 13:32
Indie game developers - common words translation sheet by www.bladko.comをスクレイピングする。 依存:jquery、jquery.csv.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>transdb JSON</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="jquery.csv.js"></script>
<script>
var csv_urls =
@mofukuma
mofukuma / transdb_unity.cs
Last active December 16, 2015 02:29
C# Unity(jsonfx使用時)
WWW www = new WWW ("http://mfk.sakura.ne.jp/sblo_files/kumaden/image/transdb.json");
yield www;
var langdb = JsonFx.Json.JsonReader.Deserialize<LangDB>(www.text);
Debug.Log( langdb.JA["FREE to download"] );
//----
[System.Serializable]
public class LangDB
{
public Dictionary<string, Dictionary<string, string>> EN;
@mofukuma
mofukuma / transdb_sample.js
Last active December 16, 2015 02:29
transdb.jsonの使用方法 ※HTML5 (jQuery使用時)
$.get("http://mfk.sakura.ne.jp/sblo_files/kumaden/image/transdb.json", function(data){
var langdb = eval(data);
console.log( langdb["JA"]["FREE to download"] ); //ロケール→英文で指定
});
//結果
//> 無料ダウンロード
//
@mofukuma
mofukuma / gae_utf8.py
Created February 11, 2013 11:43
GAE/Pythonで日本語を使うには内部処理文字コードをUTF-8に設定をする必要あり。
#!-*- coding:utf-8 -*-
#!/usr/bin/env python
#おまじない-------------
import sys
stdin = sys.stdin
stdout = sys.stdout
reload(sys)
sys.setdefaultencoding('utf-8')
sys.stdin = stdin