This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display a list of all connected Android devices | |
# Set ANDROID_SERIAL environment from selected item | |
# Example of use : # adb-setdev && adb install -r myapp.apk | |
function adb-setdev() | |
{ | |
devices=($(adb devices|grep "device$"|cut -f1)) | |
devices_count=${#devices[*]} | |
if [ "$devices_count" -eq "0" ] | |
then | |
unset ANDROID_SERIAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display a list of all installed avd, | |
# prompt user to select, | |
# then run emulator with option -avd set | |
# Example of use : # emulator-avd | |
function emulator-avd() | |
{ | |
avds=($(for f in `find ~/.android/avd/*.ini -iname "*.ini"`; do echo `basename $f .ini`; done)) | |
select avd in ${avds[*]} | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Converts color codes from text to html | |
# so that colors can be visible in a browser | |
# | |
import re | |
import sys | |
HTML_START="<html><head /><body><pre>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# 1. Save this file in your ~/.gimp-2.8/plug-ins/ directory | |
# 2. Run gimp from terminal | |
# 3. Go to Filters/Python-Fu/IPython Console | |
# 4. Go back to terminal to enjoy interactive Gimp scripting | |
# | |
import gimpfu | |
import gimp | |
from gimpfu import pdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# invoke global X session script | |
#. /etc/X11/Xsession | |
# HOW-TO : | |
# 1. Disable any Display Manager (lightdm/gdm/gdm3) from executing on startup | |
# 2. Allow user to start X : | |
# a. Edit /etc/X11/Xwrapper.config | |
# b. Set value : "allowed_users=anybody" | |
# 3. insert "su kiosk -c xinit &" into /etc/rc.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import gtk | |
from gtk import gdk | |
import webkit | |
import gobject | |
page_url = len(sys.argv)>1 and sys.argv[1] or 'http://www.google.com' | |
gobject.threads_init() | |
win = gtk.Window() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 create fresh git clone | |
#2 track all remote branches | |
for b in `git branch -r | sed "s/ origin\///g"`; do git branch $b -t origin/$b; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vsct; | |
import org.junit.Test; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.concurrent.TimeUnit; | |
import static org.junit.Assert.assertEquals; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
public class DynamicProxy { | |
private static final InvocationHandler INVOKE_DO_NOTHING = new InvocationHandler() { | |
@Override | |
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find Unused (unreferences) layouts in android project | |
for f in `find ./src -iname "*.xml" | grep res/layout`; do echo $f ; git grep --count -e "R\.layout\.$(basename $f .xml)\W" --or -e "@layout/$(basename $f .xml)\W" | wc -l ; done | grep -B1 "^0" |
OlderNewer