Skip to content

Instantly share code, notes, and snippets.

View nutti's full-sized avatar

nutti nutti

View GitHub Profile
@nutti
nutti / hoge.py
Last active September 5, 2015 13:16
[Blender] Blenderプラグインの作り方 ref: http://qiita.com/nutti/items/a836391723bd28cd3e4c
# メイン関数
if __name__ == "__main__":
register()
@nutti
nutti / menu_1.py
Last active August 29, 2015 14:10
[Blender] プラグインでサブメニューを作成する方法 ref: http://qiita.com/nutti/items/3f75f34adab99a805a35
# メニュー
class CHoge(bpy.types.Operator):
bl_idname = "uv.hoge" # ID名
bl_label = "Hoge Menu" # メニューに表示される文字列
bl_description = "Hoge Piyo" # メニューに表示される説明文
bl_options = {'REGISTER', 'UNDO'}
# 実際にプラグインが処理を実施する処理
def execute(self, context):
@nutti
nutti / Aspect_Ratio_Controller-part1.js
Last active August 29, 2015 14:10
[Unity] 複数の端末の解像度に対応させる1 - Sceneに表示される解像度を固定化する ref: http://qiita.com/nutti/items/733f296c5a09b6867baa
var offset : Vector2 = Vector2(0.0f, 0.0f); // 中心からのずれ
var scale : Vector2 = Vector2(1.0f, 1.0f); // カメラの拡大率
var cam : Camera = null; // アスペクト比を固定化するカメラ
private var width : float = 640.0f; // 横幅 (目標解像度)
private var height : float = 960.0f; // 高さ (目標解像度)
var targetAspect : float; // 目標のアスペクト比
var curAspect : float; // 補正前の「Scene」のアスペクト比
var ratio : float; // 補正前の「Scene」のアスペクト比 ÷ 目標のアスペクト比
@nutti
nutti / .wgetrc
Last active August 29, 2015 14:10
[Linux] wgetをプロキシ経由で実行する方法 ref: http://qiita.com/nutti/items/4ed09d3d61ccad49069b
http_proxy=http://${xxx.xxx.xxx.xxx}:${pp}/
proxy_user=${user}
proxy_password=${pass}
@nutti
nutti / Fixed_GUI_Layout.js
Last active August 29, 2015 14:11
[Unity] 複数の端末の解像度に対応させる2 - GUITexutreの表示を解像度と非依存にする ref: http://qiita.com/nutti/items/f4e0d4241480345a2b10
#pragma strict
var aspectRatioCtrl : Fixed_Aspect_Ratio = null; // 解像度固定スクリプト
var x : float = 0.0f; // 表示位置(X座標)
var y : float = 0.0f; // 表示位置(Y座標)
var width : float = 1.0f; // 横幅
var height : float = 1.0f; // 縦幅
function Update()
{
@nutti
nutti / optimize_sample_1.py
Created January 24, 2015 07:39
[Blender] BlenderプラグインをBlender本体に取り込んでもらうまでの流れ ref: http://qiita.com/nutti/items/a63eb404a506c2081be2
>>> l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> double_l = []
>>> for i in l:
... double_l.append(i * 2)
...
>>> double_l
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
@nutti
nutti / cleanup_env.sh
Last active August 29, 2015 14:14
[PhoneGap/Cordova] InAppBrowserを用いてDatabase.comの認証をする方法 ref: http://qiita.com/nutti/items/a154b6ef0c0608bd99ec
$ cordova platform rm ios
@nutti
nutti / get_edge_selection_sequence.py
Last active August 29, 2015 14:14
[Blender] オブジェクトの頂点・辺・面の選択順序を取得する方法 ref: http://qiita.com/nutti/items/384109ec6ed6d4a2e9f9
import bpy
import bmesh # 追加でインポートが必要
obj = bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT') # 処理はEDITモードで行う必要がある
bm = bmesh.from_edit_mesh(obj.data)
# blenderのバージョンが2.73以上の時に必要
if bpy.app.version[0] >= 2 and bpy.app.version[1] >= 73:
@nutti
nutti / custom_zepto.sh
Last active August 29, 2015 14:15
Customize zepto.js
$ git clone https://github.com/madrobby/zepto.git
$ cd zepto
$ npm install
$ MODULES="zepto event ajax form ie touch" npm run-script dist
$ ls dist
zepto.js zepto.min.gz zepto.min.js
@nutti
nutti / get_contrib_list.js
Last active August 29, 2015 14:15
Qiitaから特定ユーザの投稿の一覧を取得する
var user = 'YOUR_NAME'; // ユーザ名
$.ajax({
url: 'https://qiita.com/api/v1/users/' + user + '/items',
type: 'GET',
dataType: 'json',
scriptCharset: 'utf-8',
success: function(res) {
// 成功した時の処理
},