Skip to content

Instantly share code, notes, and snippets.

@tatuas
tatuas / gist:8470793
Created January 17, 2014 09:49
gitでコミット時にコミッター情報を変更する
$ git commit --amend --author="Yamaha Taro <new_name@example.com>"
@tatuas
tatuas / gist:8470775
Created January 17, 2014 09:48
gitでブランチ内コミッターのメールアドレスを一括変更する
$ git filter-branch -f --env-filter 'GIT_AUTHOR_EMAIL="mail@address.com"' master
@tatuas
tatuas / gist:8256990
Created January 4, 2014 16:19
netstatメモ。
$ netstat -an
@tatuas
tatuas / WebView.java
Created January 4, 2014 16:10
WebViewClientでタッチのロードかブラウザからのロードかを判別。
@Override
public boolean shouldOverrideUrlLoading(WebView view, String urlStr) {
if (view.getHitTestResult().getType() > 0) {
Log.v("load", "click");// From a user click, handle it yourself.
Intent i = new Intent(Intent.ACTION_VIEW, AdViewClient.uri);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
view.getContext().startActivity(i);
return true;
} else {
// Nothing clicked, assumed to be a redirect, let it redirect. From a user click, handle it yourself.
@tatuas
tatuas / gist:8256848
Created January 4, 2014 16:05
MySQLメモ。
http://dev.mysql.com/downloads/mysql/
community server 5.1.xxxがおすすめ。
MySQLは大文字小文字区別されない模様。
create database sampledb character set utf8;
use sampledb;
create table sampletb (id integer, name varchar(64));
show tables;
insert into sampletb(id, name) value(1, "hello");
@tatuas
tatuas / gist:8256846
Created January 4, 2014 16:04
MySQLでバージョン確認
mysql> select version();
@tatuas
tatuas / gist:8256828
Created January 4, 2014 16:03
JNIのサンプル
JnIEnv* envとする(JNICALLで定義)
env->GetIntArrayElements(jintArray, isCopy);
配列の要素をコピーする。
メモリにコピーするか、メモリを参照するかのいずれかはisCopyで選択。
ex) Jint* _widths = env->GetIntArrayElements(widths, 0);
env->GetObjectArrayElement(objectArray, i);
指定した配列の内容をコピーする。
多重配列から要素を取り出す際に使用する。
@tatuas
tatuas / gist:8256808
Created January 4, 2014 16:02
jQueryでタッチ処理(サンプル)
function testingTouch() {
var isTouch = ('ontouchstart' in window);
$('#hoge').bind({
'touchstart mousedown' : function(e) {
e.preventDefault();
this.pageX = ( isTouch ? event.changedTouches[0].pageX : e.pageX);
this.pageY = ( isTouch ? event.changedTouches[0].pageY : e.pageY);
this.left = $(this).position().left;
@tatuas
tatuas / gist:8256804
Created January 4, 2014 16:01
Apache on Ubuntu
$ sudo apt-get install apache2 php5 php5-gd mysql-server php5-mysql phpmyadmin
すべてはいを選ぶ。
mysqlパスワードは、とりあえずrootにした。
http://localhost/
でItWorks!が動けばOK.
@tatuas
tatuas / gist:8256796
Created January 4, 2014 16:01
Apache on Windows
http://www.apache.org/dist/httpd/binaries/win32/
http://php.net/downloads.php
Pathを通す
C:/Apache2.2/bin
listen 80
<Directory />
Options FollowSymLinks
AllowOverride All