Skip to content

Instantly share code, notes, and snippets.

@bols-blue
bols-blue / build.xml
Created January 11, 2012 07:05
android_ant_sample
<project name="sample_project" default="help">
<property file="${basedir}/ant.properties" />
<loadproperties srcFile="${basedir}/project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
@mike-neck
mike-neck / TimeAvatar.groovy
Created December 21, 2011 10:52
inspired by image change script git://gist.github.com/1481409.git written by Yusuke Yamamoto. see https://gist.github.com/1481409
/**
* Copyright (C) 2011 Yusuke Yamamoto
* Licensed under the Apache License, Version 2.0 (the "License");
* http://www.apache.org/licenses/LICENSE-2.0
*
*
**/
@Grab(group='quartz', module='quartz', version='1.5.2')
@Grab(group='org.twitter4j', module='twitter4j-core', version='2.2.5')
import SimpleOpenNI.*;
SimpleOpenNI kinect;
ArrayList<PVector> handPositions;
PVector currentHand;
PVector previousHand;
void setup() {
size(640, 480);
@glaforge
glaforge / build.gradle
Created November 25, 2011 16:04 — forked from Dierk/build.gradle
build.gradle for setting up a new gradle-based project
apply plugin:'groovy'
apply plugin:'idea'
repositories { mavenCentral() }
dependencies {
groovy 'org.codehaus.groovy:groovy-all:1.8.4'
}
task makeDirs(description:'make all dirs for project setup') << {
@irof
irof / gist:1361388
Created November 13, 2011 00:57
JUnitでAssertを使わずSystem.out.printlnするひとに警告する
System.setOut(new PrintStream(new OutputStream() {
@Override
public void write(int b) throws IOException {
throw new RuntimeException("Assert使え(#゚Д゚)ゴルァ!!");
}
}));
@bikisuke
bikisuke / excel2AstahDomain.groovy
Created November 6, 2011 01:15
gexcelapiを使って、Excelからastah*のドメイン定義を作成するサンプル。(要astah* professionalライセンス)
import com.change_vision.jude.api.inf.project.*
import com.change_vision.jude.api.inf.model.*
import com.change_vision.jude.api.inf.editor.*
import org.jggug.kobo.gexcelapi.GExcel
class AstahGenerator {
static generate(data) {
def pa = ProjectAccessorFactory.getProjectAccessor()
def editor = ModelEditorFactory.getERModelEditor()
@orangeclover
orangeclover / GroovyRun.mac
Created November 5, 2011 07:03
秀丸でGroovy
// GroovyRun:Groovy実行マクロ
// GroovyとGroovyServが必要です。
//
// 設定
//
// 環境変数PATHを設定してなければ、groovyclientを絶対パスの設定
// 環境変数PATHを設定してあれば、変更不要
// 例
@xnrghzjh
xnrghzjh / BeansValidator.java
Created October 13, 2011 00:16
Hibernate Validator を使ったバリデーション
public class BeansValidator {
private ClassValidator classValidator;
private List<String> validMessages = new ArrayList<String>();
private BeansValidator() {}
public BeansValidator(Class clazz) throws Exception{
classValidator = new ClassValidator(clazz);
@alterakey
alterakey / start-intent-test.sh
Created October 11, 2011 14:56
An experimental test instrument launcher for Android
#/bin/bash
pkg=$1
intr() {
adb shell am start -a android.intent.action.MAIN -c android.intent.category.HOME
exit 0
}
trap intr INT
adb shell am instrument -w ${pkg}/android.test.InstrumentationTestRunner &
anonymous
anonymous / gist:1274924
Created October 10, 2011 09:11
Receiver/Permission全部取得する奴
package product.miyabi.android.broadcasttest;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;