Skip to content

Instantly share code, notes, and snippets.

@flocsy
flocsy / VersionPreference.java
Created Feb 11, 2016
display your app's version in preferences screen
View VersionPreference.java
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 <flocsy@gmail.com>
View siren.go
package main
// Credits: http://stackoverflow.com/a/24683083/351947
import (
"encoding/binary"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"unicode/utf16"
View 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
View applog.sh
#!/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}:"