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
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();
}
//Andon's Color Badge basic program.
//Utilizes the ST7735 driver from Adafruit and the Adafruit Graphics Library
//Documentation can be found here: https://learn.adafruit.com/adafruit-gfx-graphics-library/graphics-primitives
//Due to size constraints (And my own coding abilities), no SD card interactions are programmed in.
//However, the standard SD card library can be used. I've added the SD card chip select pin below for reference.
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
@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 / aDarkRoomNotifierForTamperMonkey.js
Created September 6, 2016 12:17
Give notifications when A Dark Room's Gather button should be clicked again
// ==UserScript==
// @name A Dark Room notifier
// @namespace http://adarkroom.doublespeakgames.com/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://adarkroom.doublespeakgames.com/
// @grant none
// ==/UserScript==