Skip to content

Instantly share code, notes, and snippets.

View decnorton's full-sized avatar

Declan Norton decnorton

View GitHub Profile

Keybase proof

I hereby claim:

  • I am decnorton on github.
  • I am decnorton (https://keybase.io/decnorton) on keybase.
  • I have a public key whose fingerprint is 272E 1EB0 8314 9738 617F D2A5 BD62 0245 102F 35F3

To claim this, I am signing this object:

@decnorton
decnorton / app_Database_PostgresConnection.php
Created September 4, 2015 00:49
Basic support for Postgres UUID columns with the Laravel 5 schema builder
<?php
namespace App\Database;
use App\Database\Schema\Blueprint;
use App\Database\Schema\PostgresGrammar;
use Illuminate\Database\PostgresConnection as BasePostgresConnection;
class PostgresConnection extends BasePostgresConnection
{
@decnorton
decnorton / QuickReturn.java
Created July 7, 2014 13:20
Easy quick return. No need for dodgy observable ListView hacks.
public class QuickReturn {
private static final String TAG = "QuickReturn";
protected GestureDetectorCompat mGestureDetector;
private Context mContext;
private View mQuickReturnView;
private View mTargetView;
public QuickReturn(Context context, View targetView, View quickReturnView) {
mContext = context;
@decnorton
decnorton / gist:8835365
Created February 5, 2014 23:15
Enable Volley logging
adb shell setprop log.tag.Volley VERBOSE
@decnorton
decnorton / install.sh
Created January 28, 2014 20:39
VPN Routing
#!/bin/sh
sudo mv ip-up /etc/ppp/ip-up
sudo chmod a+x /etc/ppp/ip-up
sudo chown root /etc/ppp/ip-up
@decnorton
decnorton / array-remove.js
Last active December 19, 2015 16:29
Adds .remove() method to Array.
/**
* Array Remove
*
* Based on code by John Resig http://ejohn.org/blog/javascript-array-remove/
*/
Array.prototype.remove = function(from, to) {
// If first arg is not a number, try and find it in the array
if(isNaN(from)) {
from = this.indexOf(from);
if(from < 0) {
@decnorton
decnorton / Android - File SHA1 check
Last active August 22, 2016 08:48
Android. Check the SHA1 of a file against a string
public static boolean testSHA1(String sha1, File file) {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA1");
} catch (NoSuchAlgorithmException e) {
Log.e(TAG, "Exception while getting Digest", e);
return false;
}
InputStream is;