Skip to content

Instantly share code, notes, and snippets.

TomTasche / Gruntfile.js
Created Dec 27, 2015
dispatcher for multi-module appengine setups
View Gruntfile.js
// ...
var proxySnippet = require("grunt-connect-proxy/lib/utils").proxyRequest;
gruntConfig.connect = {
server: {
options: {
port: 9000,
hostname: "",
keepalive: true,
middleware: function(connect, options) {
TomTasche /
Created Sep 1, 2014
commands i used to extract the ssl-certificate from a running system for usage with heroku
keytool -list -keystore keystore.jks
keytool -export -alias 1 -keystore store.jks -file store2.crt
openssl x509 -in store2.crt -out store2-pem.crt -outform pem -inform der
keytool -v -importkeystore -srckeystore store.jks -srcalias 1 -destkeystore store2.p12 -deststoretype PKCS12
openssl pkcs12 -in store2.p12 -out store2.pem
openssl rsa -in store2.key -inform DER -out store2-nopw.key
View IDViewController.m
// IDViewController.m
// MyFirstIndoorsApp
// Copyright (c) 2013 GmbH. All rights reserved.
#import "IDViewController.h"
#import <CoreLocation/CoreLocation.h>
TomTasche / ndk-gdb-remote
Last active May 8, 2018
ndk-gdb of NDK r9d modified to *always* debug the ":remote"-process of your app
View ndk-gdb-remote
# Copyright (C) 2010 The Android Open Source Project
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#replace count=1024 with the number of MB (!) you want to grow the image file
dd if=/dev/zero bs=1024k count=1024 >> my_loop_image_file
e2fsck -f my_loop_image_file
resize2fs my_loop_image_file
TomTasche / debug_log.cpp
Last active Dec 31, 2015
console output in C++
View debug_log.cpp
std::cout << "debug message: " << array.size() << std::endl;
TomTasche /
Created Nov 10, 2013
reading a file from WEB-INF folder in AppEngine. lots of answers on StackOverflow are actually incorrect (most of them missing the leading slash)
InputStream stream = getServletContext().getResourceAsStream("/WEB-INF/file.txt");
TomTasche / AndroidManifest.xml
Last active Feb 9, 2021
OAuth flow using the AccountManager on Android
View AndroidManifest.xml
<!-- ... -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- ... -->
TomTasche /
Created May 9, 2013
a demonstration of a file upload without any additional libraries on Android. More information here:
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
try {
InputStream stream = req.getInputStream();
// do whatever you want with the stream now
} catch (Exception ex) {
throw new ServletException(ex);
TomTasche /
Last active Dec 17, 2015
this gist describes how to 1. get an OAuth token from Android's AccountManager, 2. use this token to connect with GTalk via XMPP. Blog post about it:
// taken from:
// note: you don't have to change anything in this class
public class GTalkOAuthSASLMechanism extends SASLMechanism {
public static final String NAME = "X-GOOGLE-TOKEN";
public GTalkOAuthSASLMechanism(SASLAuthentication saslAuthentication) {