Skip to content

Instantly share code, notes, and snippets.

View stefanhoth's full-sized avatar
:shipit:
Shipping it

Stefan Hoth stefanhoth

:shipit:
Shipping it
View GitHub Profile
SDK_HOME_PATH="$HOME"
SDK_PATH="$SDK_HOME_PATH/android-sdk-linux"
# Needs to be updated when new releases are made
SDK_DOWNLOAD_URL="http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz"
curl --location $SDK_DOWNLOAD_URL | tar -xz -C $SDK_HOME_PATH
# Just install platform-tools, build-tools & Android-19
# Filter names are from `android list sdk -e -a`
@stefanhoth
stefanhoth / GradleWorkersPleaseStopTakingFocus.gradle
Last active August 29, 2015 14:25 — forked from artem-zinnatullin/GradleWorkersPleaseStopTakingFocus.gradle
Prevent Gradle Workers from taking focus! #DevelopersLikeComfort
// You can place it in the root build.gradle
allprojects {
tasks.withType(JavaForkOptions) {
// Forked processes like GradleWorkerMain for tests won't steal focus!
jvmArgs '-Djava.awt.headless=true'
}
}
@stefanhoth
stefanhoth / device_provider.gradle
Last active August 29, 2015 14:21
Allow gradle to only use devices that meet your criteria
android {
...
deviceProvider new AwesomeDeviceProvider(getAdbExe())
}
class AwesomeDeviceProvider extends com.android.builder.testing.ConnectedDeviceProvider {
AwesomeDeviceProvider(File adbLocation) {
super(adbLocation)
}
@stefanhoth
stefanhoth / gist:5d6fa521aad322d15d44
Last active August 29, 2015 14:14 — forked from anonymous/gist:1571520dd1aa934fce28
Simple Factory pattern
// The Factory
public final class VehicleFactory {
// private constructor => can't be instanciated, final can't be extended since the constructor is not reachable for a subclass
private VehicleFactory (){
// no-op
}
public static Vehicel Vehicle produceVehicle(String name, String manufacturer, int horsepowerInPS){
return new Vehicle(name, manufacturer, horsepowerInPS);
/*
* Mass Emailer Google Spreadsheet and Forms Script.
*
* Changelog:
*
* 30. Apr. 2013
* - add support for Form submit auto-replies
* 27. Apr. 2013
* - trial checkbox allows easier debugging
* 16. Feb. 2012
@stefanhoth
stefanhoth / gist:3749214
Created September 19, 2012 11:38 — forked from gnunicorn/gist:3748738
Git for Beginners: Call for Coaches

The OpenTechSchool has set up and hosted a few tech workshops and meetups here in Berlin now. Aside from the monthly Beginners Meetup and hosting the Udacity Global Meetup we hosted workshops for program beginners in Python and Javascript on our own and on the premise of CampusParty.

One thing that was extraordinary popular on CampusParty was the Workshop on Git for beginners. And we decided to do it again, this time with a closer focus on version control as a major benefit in code sharing (by using git and github) for beginners - free of charge.

So if you are interested in

@stefanhoth
stefanhoth / gist:3749213
Created September 19, 2012 11:38 — forked from gnunicorn/gist:3748738
Git for Beginners: Call for Coaches

The OpenTechSchool has set up and hosted a few tech workshops and meetups here in Berlin now. Aside from the monthly Beginners Meetup and hosting the Udacity Global Meetup we hosted workshops for program beginners in Python and Javascript on our own and on the premise of CampusParty.

One thing that was extraordinary popular on CampusParty was the Workshop on Git for beginners. And we decided to do it again, this time with a closer focus on version control as a major benefit in code sharing (by using git and github) for beginners - free of charge.

So if you are interested in

@stefanhoth
stefanhoth / server.js
Created December 22, 2011 15:51 — forked from jeffrafter/server.js
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {