Skip to content

Instantly share code, notes, and snippets.

View charroch's full-sized avatar
🏠
Working from home

Carl-Gustaf Harroch charroch

🏠
Working from home
View GitHub Profile
@charroch
charroch / gist:5421998
Created April 19, 2013 17:55
ABS gradle
task wrapper(type: Wrapper) {
gradleVersion = '1.3'
}
buildscript {
repositories {
mavenCentral()
}
@charroch
charroch / Foo.java
Last active December 10, 2015 20:18
Vogar new run
package foo;
public class Foo {
public int test() { return 0; }
}
local/acroread 9.5.1-2
local/adobe-air 2.1-1
local/adobe-air-sdk 2.6-2
local/android-udev 1.2-1
local/arduino 1:1.0.1-1
local/aspectj 1.6.12-1
local/cairo-cleartype 1.12.2-1
local/cdm-git 20120605-1
local/coffee-script 1.3.3-1
local/dfu-programmer 0.5.4-1
package com.hubstep;
import android.accounts.*;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
@charroch
charroch / SpecInstrumentationRunner
Created April 17, 2012 10:39
SpecInstrumentationRunner on android
package org.scalatest.tools
import org.scalatest._
import dalvik.system.DexFile
import java.io.File
import android.os.{Looper, Bundle}
import android.test.{AndroidTestCase, InstrumentationTestCase}
import scala.collection.JavaConversions._
import android.app.{Activity, Instrumentation}
@charroch
charroch / gist:1988640
Created March 6, 2012 19:56
HelloWorld on dalvik
package com.hello
import java.lang.String
import android.net.Uri
import com.android.dx.dex.DexOptions
import com.android.dx.dex.file.DexFile
import dalvik.system.DexClassLoader
import java.io.{PrintWriter, FileInputStream, FileOutputStream, File}
import com.android.dx.dex.cf.{CfOptions, CfTranslator}
#!/usr/bin/ruby
require 'rubygems'
require 'git'
g = Git.open(".")
log = g.log(10000)
c = log.collect {|l| l.date.yday}
(commit_count = {}).default = 0
c.each {|e| commit_count[e] += 1}
trait AndroidDeviceAction
case class Install extends AndroidDeviceAction
case class Instrument(options:InstrumentOptions) extends AndroidDeviceAction
case class Monkey extends AndroidDeviceAction
case class MoneyScript(script:Script) extends AndroidDeviceAction
class AndroidDevice extends Actor with IDevice {
def receive = {
case Install => // install app
case Instrument =>
import java.text.SimpleDateFormat
import java.util.Date
class RichHumanDate(d:Long) {
def toHumanString() = {
val sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS");
val dt = new Date(d);
sdf.format(dt);
}
}
import java.text.SimpleDateFormat
import java.util.Date
class RichHumanDate(d:Long) {
def toHumanString() = {
val sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS");
val dt = new Date(d);
sdf.format(dt);
}
}