Skip to content

Instantly share code, notes, and snippets.

@kimukou
kimukou / env.txt
Last active October 11, 2015 02:48
facebook4j_twitter4j_compare
GroovyConsleの動きがいまいちの場合は以下を修正すること
(groovyConsoleのシェルの方を治すのも可。特にMac!!)
$GROOVY_HOME/bin
startGroovy
## 先頭に
export JAVA_HOME=/Library/Java/Home
export JAVA_OPTS='-Dgroovy.source.encoding=UTF-8 -Dfile.encoding=UTF-8'
@kimukou
kimukou / adb_test_builder.groovy
Last active October 10, 2015 09:28
android_groovyToyScript
//println("path => " + this.class.protectionDomain.codeSource.location.path)
//println("fileName => " + new File(this.class.protectionDomain.codeSource.location.file).name)
def loc=this.getClass().getProtectionDomain().getCodeSource().getLocation()
println "===start($loc)==="
def testClass =['com.nihon0tc.example.test.AdTest',
'com.nihon0tc.example.test.AdManagerTest#testManager']
def prop0 = new Properties()
@kimukou
kimukou / OptionGroupAdapter.java
Created September 2, 2012 14:10
android_OptionGroupAdapter_update
import java.util.ArrayList;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckedTextView;
import android.widget.ImageView;
@kimukou
kimukou / LogUtil.java
Last active October 9, 2015 23:57
andrid_logUtil
//ref https://gist.github.com/3595115
import android.util.Log;
import com.nihon0tc.ad.BuildConfig;
public class LogUtil {
public static void debug(String tag,Object msg)
{
@kimukou
kimukou / error
Created September 1, 2012 05:02
ant test error
[exec] android.content.res.Resources$NotFoundException: String array resource ID #0x7f050000
[exec] at android.content.res.Resources.getStringArray(Resources.java:393)
@kimukou
kimukou / showMessageBoxUpdate.java
Last active October 9, 2015 08:48
android_updatenotify
private static AlertDialog updateDialog = null;
private Resources m_r = null;
public void showMessageBoxUpdate(final String title, final String message) {
if(m_r ==null)m_r = getResources();
if(updateDialog!=null){
updateDialog.dismiss();
updateDialog=null;
}
LogUtil.trace(TAG, "title = " + title);
LogUtil.trace(TAG, "message = " + message);
@kimukou
kimukou / hogehoge.js
Created July 21, 2012 12:21
node-cron exception
var cronJob = require('cron').CronJob;
cronJob('0 5 1 * * *', function(){
console.log('You will see this message every day');
}, null, true, "japan/tokyo");
@kimukou
kimukou / GestureCommand.java
Created July 11, 2012 15:28
Gesture Command
// 右下=>左上、左下=>右上 のコマンド入力イメージ
private int fling_count = 0;
private final SimpleOnGestureListener onGestureListener = new SimpleOnGestureListener() {
@Override
public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) {
//横向き基準
float BASE_X = 400;
float BASE_Y = 200;
@kimukou
kimukou / limit_check
Created July 9, 2012 02:32
hashtag realtime search
http://otter.topsy.com/credit.json
{
response: {
limit: 3000,
reset: 1341903600,
refresh_in_secs: 83684,
remaining: 2675
},
request: {
@kimukou
kimukou / create_uuid.java
Created June 28, 2012 14:40
android_Preferences
private String create_uuid() {
String sUUID = get_string("uuid",null);
if(sUUID!=null)return sUUID;
UUID uuid = UUID.randomUUID();
sUUID= uuid.toString();
Log.v(TAG, "uuid gen " + sUUID);
put_string("uuid",sUUID);
return sUUID;
}