Skip to content

Instantly share code, notes, and snippets.

View ncornette's full-sized avatar

Nicolas Cornette ncornette

View GitHub Profile
@ncornette
ncornette / ipython_console.py
Last active November 3, 2023 23:28
Gimp plugin for interactive Gimp scripting using IPython
#!/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
@ncornette
ncornette / colors2html.py
Created August 20, 2012 13:28
converts color codes to html for colors to be displayed in a browser
#!/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>"
@ncornette
ncornette / gist:3370010
Last active February 25, 2017 23:24
An interactive Bash function for Android that runs emulator by prompting you a list of all installed avd
# 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
@ncornette
ncornette / gist:3272344
Created August 6, 2012 08:49
An interactive Bash function that allow you to select an Android device in a list then Sets ANDROID_SERIAL
# 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