Skip to content

Instantly share code, notes, and snippets.

View benvd's full-sized avatar

Ben Van Daele benvd

  • Antwerp, Belgium
View GitHub Profile
@benvd
benvd / ggs
Created January 17, 2014 09:51
ggs: git global status. For a set of repos, display whether they are dirty and/or have unpushed commits.
#!/bin/bash
repos=(
"/path/to/a/repo"
"/path/to/another/repo"
)
function isClean {
# Check for unstaged changes, staged changes, untracked files
git diff-files --quiet && git diff-index --quiet --cached HEAD && test -z "$(git ls-files --exclude-standard --others)"
#!/usr/bin/python2
from pyudev import Context, Monitor, MonitorObserver
import subprocess
import re
import shlex
OUTPUTS = {
'LVDS1': '--mode 1600x900 --pos 0x0 --rotate normal',
@benvd
benvd / FadeInNetworkImageView.java
Created May 31, 2013 09:16
Extension of Volley's NetworkImageView that fades in images as they're loaded
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.*;
import android.util.AttributeSet;
import com.android.volley.toolbox.NetworkImageView;
public class FadeInNetworkImageView extends NetworkImageView {
private static final int FADE_IN_TIME_MS = 250;
@benvd
benvd / MainActivity.java
Created January 28, 2013 21:34
UNICORN
package be.benvd.unicorn;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.widget.TextView;
@benvd
benvd / UndoBarController.java
Created November 16, 2012 21:18
Roman Nurik's UndoBarController, using NineOldAndroids
/*
* Copyright 2012 Roman Nurik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@benvd
benvd / android-addr2line.py
Created May 10, 2012 13:23
Android addr2line wrapper
#!/usr/bin/python
import sys
import re
import subprocess
ADDR2LINE_BINARY='' # full path to arm-linux-androideabi-addr2line
LIBRARY='' # full path to your .so file
def main():
print 'Paste the stack trace. CTRL-D to submit. CTRL-C to exit.'
@benvd
benvd / coloredlogcat.py
Created January 10, 2012 10:27
Modifying the Android logcat stream for full-color debugging (Jeff Sharkey)
#!/usr/bin/python
'''
Copyright 2009, The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0