Skip to content

Instantly share code, notes, and snippets.

@flocsy
flocsy / VersionPreference.java
Created February 11, 2016 13:33
display your app's version in preferences screen
package com.fletech.android.preference;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.preference.Preference;
import android.util.AttributeSet;
/*
Author: Gavriel Fleischer <[email protected]>
@flocsy
flocsy / siren.go
Created August 7, 2014 00:31 — forked from rafi/siren.go
package main
// Credits: http://stackoverflow.com/a/24683083/351947
import (
"encoding/binary"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"unicode/utf16"
@flocsy
flocsy / lolcat.rb
Last active August 29, 2015 14:04 — forked from xaethos/lolcat.rb
#!/usr/bin/env ruby
require 'colorize'
require 'optparse'
class LOLCat
def initialize options = {}
@adb_args = options[:adb_args] || []
@tagspecs = options[:tagspecs] || []
@whitelist = options[:processes] || []
@processes = Hash.new
#!/bin/sh
PACKAGE=$1
APPPID=`adb -d shell ps | grep "${PACKAGE}" | cut -c10-15 | sed -e 's/ //g'`
adb -d logcat -v long \
| tr -d '\r' | sed -e '/^\[.*\]/ {N; s/\n/ /}' | grep -v '^$' \
| grep " ${APPPID}:"