Skip to content

Instantly share code, notes, and snippets.


John Carlson Jawnnypoo

View GitHub Profile
View gist:5852c6285930eeeca6deaf82c4d92677
long days = ChronoUnit.DAYS.between(, otherDate);
Jawnnypoo / styles.xml
Created Apr 7, 2016
AppCompatDialog theme
View styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/white</item>
<item name="android:textColorPrimary">@color/black</item>
<item name="alertDialogTheme">@style/AppAlertDialogStyle</item>
Jawnnypoo /
Created Mar 8, 2016
Timber tree which prints error messages and stack traces to Crashlytics
package com.example;
import android.util.Log;
import timber.log.Timber;
* {@link timber.log.Timber.Tree} which prints important messages to Crashlytics
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<color name="white">#ffffffff</color>
<color name="white_90">#E6ffffff</color>
<color name="white_80">#CCffffff</color>
<color name="white_70">#B3ffffff</color>
<color name="white_60">#99ffffff</color>
<color name="white_50">#80ffffff</color>
<color name="white_40">#66FFFFFF</color>
Jawnnypoo / BuildScript.cs
Last active Oct 19, 2021
Typical Buildscript for Unity on Jenkins. Run with command line args "-quit -batchmode -projectPath ${WORKSPACE} -executeMethod BuildScript.PerformAndroidBuild -logfile /dev/stdout"
View BuildScript.cs
using UnityEditor;
using System;
using System.Collections.Generic;
class BuildScript {
static string[] SCENES = FindEnabledEditorScenes();
static string APP_NAME = "AngryBots";
static string TARGET_DIR = "target";
View gist:136f5049534484906acb
### Keybase proof
I hereby claim:
* I am Jawnnypoo on github.
* I am jawnnypoo ( on keybase.
* I have a public key whose fingerprint is 6685 FBCB 3BF0 3236 DDB8 0B53 816A 9180 2393 C178
To claim this, I am signing this object:
Jawnnypoo /
Last active Aug 8, 2017
Common Android Intents, as builders
import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.provider.CalendarContract;
import android.provider.CalendarContract.Events;
import android.provider.AlarmClock;
Jawnnypoo / ObjectAnimator Change Icon Color
Last active May 13, 2020
Use ObjectAnimator to change color of an icon dynamically
We couldn’t find that file to show.
Jawnnypoo / onPreDrawExample
Created Dec 10, 2014
Example of setting an onPreDrawListener on a view
View onPreDrawExample
final View view = findViewById(;
view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
public boolean onPreDraw() {
//Do the things you want to do. Return true if you want to draw that frame, otherwise return false
return false;
Jawnnypoo /
Last active Dec 7, 2019
Accelerometer example that shows moving a circle based on accelerometer input.
package com.jawnnypoo.example;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;