Skip to content

Instantly share code, notes, and snippets.

View frankkienl's full-sized avatar
🤖
making Android apps

Frank Bouwens frankkienl

🤖
making Android apps
View GitHub Profile
@frankkienl
frankkienl / DiscoverTest.java
Last active December 19, 2015 13:49
How to start the OUYA Discover and OldDiscover.
/**
* This is how we can start OldDiscoverActivity
* This is possible because OldDiscoverActivity has an Intent-Filter in the AndroidManifest.XML
*/
Intent i = new Intent();
//i.setClassName("tv.ouya.console", "tv.ouya.console.launcher.store.adapter.DiscoverActivity");
i.setClassName("tv.ouya.console", "tv.ouya.console.launcher.store.OldDiscoverActivity");
try {
startActivity(i);
} catch (Exception e) {
@frankkienl
frankkienl / Upload.java
Created August 11, 2013 15:57
Upload script for simple WebServer
package nl.frankkie.web;
import java.io.File;
import java.util.Map;
import fi.iki.elonen.NanoHTTPD;
/**
* Created by FrankkieNL on 11-8-13.
*/
package nl.frankkie.randomapp;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@frankkienl
frankkienl / HttpDeleteWithBody.java
Created March 18, 2014 09:47
HttpDelete on Android
import java.net.URI;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
/**
* http://stackoverflow.com/questions/3773338/httpdelete-with-body
* @author fbouwens
*/
class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
@frankkienl
frankkienl / DeBet
Created June 19, 2014 13:15
De Bet
De Bet:
if (@W is LVL8 in Ingress op 2 juli 2014, 19:23, of eerder){
@F.geeft(@W, "6 beugelflessen");
} else {
@W.geeft(@F, "6 beugelflessen");
}
@frankkienl
frankkienl / no_recursion.js
Created August 19, 2014 17:23
Proof that some functions do not need to be recursive.
//Recursive
function A(n){
if (n <=0){return 0;}
return 1 - (1 - A( n - 1)) / 2;
}
//Not recursive, using a loop
function B(n){
if (n<=0){return 0;}
//TODO insert smart code here
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Brony MLP Überraschungspony Ratgeber</string>
<string name="main_welcome">"My Little Pony G4 Überraschungspony Ratgeber
Erstellt mit Daten der MLPMerch.com Überraschungspony-Datenbank.
Besuchen Sie MLPMerch.com für die Online Überraschungspony-Datenbank und MLP Merchandise Nachrichten!"</string>
<string name="action_settings">Einstellungen</string>
<string name="tut1">"Wussten Sie, das es gar keine große Überraschung sein muss, welches Pony sich in einer MLP-Überraschungspony Tüte versteckt?
Der Inhalt einer Überraschungspony Tüte lässt sich einfach feststellen ohne sie zu öffnen.
@frankkienl
frankkienl / designer.html
Last active August 29, 2015 14:17
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@frankkienl
frankkienl / gist:06f4ba0da8e38e553258
Created June 3, 2015 07:25
Java Exceptions Testing. Finding out how re-throwing affects the stacktrace.
//Java Exceptions Testing. Finding out how re-throwing affects the stacktrace.
//Tested in: http://www.compilejava.net/
public class HelloWorld
{
public static void main(String[] args) throws Exception
{
testThrowUp();
}
@frankkienl
frankkienl / Countries.java
Created June 24, 2015 19:13
List of countries
/*
The Spotify API call, 'top-tracks' requires a ISO 3166-1 alpha-2 country code
//https://developer.spotify.com/web-api/get-artists-top-tracks/
//https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
//https://www.spotify.com/nl/legal/end-user-agreement/plain/#s19
//EU is not included in this list, as it generates this error:
{
"error": {
"status": 400,
"message": "Invalid country code"