Skip to content

Instantly share code, notes, and snippets.

@namutaka
namutaka / mod_gravator_icon.rb
Created August 22, 2012 09:40
gitlabのavator icon変更パッチ
#
# GitLab avator icon変更パッチ
#
Rails.configuration.to_prepare do
ApplicationHelper.class_eval do
def gravatar_icon(user_email = '', size = 40)
return unless user_email
icon_site_host = "https://iconsite.example.com"
user_email.strip!
@namutaka
namutaka / .gitignore
Created August 21, 2012 14:33 — forked from bergie/.gitignore
Node.js email handling examples
config.json
reading-image.png
@namutaka
namutaka / ShowSphereColliderGizmos.js
Created July 28, 2012 16:59
UnityでのSphereColliderのGizmo表示
function OnDrawGizmos() {
var collider : SphereCollider = GetComponent(SphereCollider);
var scale = transform.localScale;
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere(
transform.TransformPoint(collider.center),
Mathf.Max(scale.x, scale.y, scale.z) * collider.radius);
}
@namutaka
namutaka / Wiget_Camera.js
Created July 28, 2012 11:00
Unityではじめるゲームづくり Wiget_Camera.js 追尾型カメラの移動処理
function LateUpdate () {
if(!target) {
print("non");
return;
}
var wantedRotationAngle = target.eulerAngles.y;
var wantedHeight = target.position.y + height;
var currentHeight = transform.position.y;
@namutaka
namutaka / dependencies.yml
Created July 27, 2012 01:44
Play1系で依存モジュールをgithubから取得する方法メモ(失敗)
require:
- play
- hina0118 -> play-doma master
repositories:
- github:
type: http
artifact: "https://github.com/[organisation]/[module]/zipball/[revision]?.zip"
contains:
- hina0118 -> *
@namutaka
namutaka / MyS2Util.java
Created July 12, 2012 02:13
S2Conteinerのコンポーネントをダンプする
class MyS2Utils {
protected Logger logger = LoggerFactory.getLogger("test");
public static void dumpComponent() {
S2Container s2Container = (S2Container) SingletonS2ContainerFactory
.getContainer().getRoot();
Object result =
Traversal.forEachComponent(
s2Container,
@namutaka
namutaka / HogeTest.java
Created July 1, 2012 14:01
PropertiesEnhancer work in Play1.2.5
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.junit.Test;
import play.Logger;
import play.test.UnitTest;
public class HogeTest extends UnitTest {
@namutaka
namutaka / gist:2803188
Created May 27, 2012 10:18
レイアウト付きで静的ページを表示させるコントローラ
#
# レイアウト付きで静的ページを表示させるコントローラ
#
# routes.rb
# map.connect "/hoge/*paths", :controller => 'static_page', :action => 'index', :subdir => 'hoge'
#
class StaticPageController < ApplicationController
#viewファイルの配置場所を別途用意する
STATIC_VIEWS_BASE = "app/static_views"
append_view_path STATIC_VIEWS_BASE
@namutaka
namutaka / git_exam.log
Created May 6, 2011 08:25
Exam Git merge work.
[~/dev/test/gittest]% export SP=file://${HOME}/dev/test/gittest/GitTest.git
[~/dev/test/gittest]% git init --bare GitTest.git
Initialized empty Git repository in /Users/namu/dev/test/gittest/GitTest.git/
[~/dev/test/gittest]% mkdir master alice bob
[~/dev/test/gittest]% cd master
[..test/gittest/master]% git clone $SP .
Cloning into ....
warning: You appear to have cloned an empty repository.
[..test/gittest/master]% mkdir common_folder alice_folder bob_folder
[..test/gittest/master]% echo "init rev.3" > common_folder/file1.txt
@namutaka
namutaka / summary.txt
Created May 1, 2011 12:55
Exam Subversion merge work.
A 4-6-7-----10----------14---|16----18----20----------24----26
/ \ / / \ | / \ / / \ /
T-3---------9-------12-------15|---------19-------22-------25
\ \ / \ | \ / \
B 5-----8------11----13------|---17----------21----23
### rev.3
common_folder/file1.txt