Skip to content

Instantly share code, notes, and snippets.

View xgouchet's full-sized avatar
📖
Writing some sci-fi novel…

Xavier F. Gouchet xgouchet

📖
Writing some sci-fi novel…
View GitHub Profile
@xgouchet
xgouchet / LogUtils.java
Last active December 26, 2015 10:49
Just setup
package fr.xgouchet.androidlib.common;
import android.util.Log;
/**
* A utility class to insert logs in Android Log Cat, with link to the line calling it (much like in an exception stack trace).
*
*/
public final class LogUtils {
@xgouchet
xgouchet / folder_diff
Last active February 16, 2024 12:32
A shell script to perform a recursive diff between two folders
#!/bin/bash
## get the folders
folder1=$1
folder2=$2
empty="..."
# check we have two folders
if [ -z "$folder2" ]; then
echo " Missing folders to diff "
@xgouchet
xgouchet / adb-debug-over-wifi
Created December 15, 2014 13:13
A script to debug an Android device over wifi
#!/bin/sh
#
# usage :
# adb-debug-over-wifi [SERIAL OF THE DEVICE]
device_serial=$1
devices_attached=`adb devices -l | grep -c "device:"`
# check the device
if [ -z "$device_serial" ]; then
@xgouchet
xgouchet / git_bash_prompt
Created January 7, 2015 08:17
A bash git prompt based on twolfson's "sexy bash prompt"
#!/usr/bin/env bash
# git bash prompt
# Based on twolfson's sexy bash prompt (https://github.com/twolfson/sexy-bash-prompt)
# If we are on a colored terminal
if tput setaf 1 &> /dev/null; then
# Reset the shell from our `if` check
tput sgr0 &> /dev/null
# If you would like to customize your colors, use
@xgouchet
xgouchet / 51-android.rules
Created January 7, 2015 15:40
Android Debug Bridge (adb) udev definition file
################################################################################
# Android Debug Bridge (adb) udev definition file
#
# This rules file will add a /dev/android_adb symlink when an Android phone with
# an identified idVendor:idProduct appears on the USB port. Then it will run the
# Android adb program (located in specified RUN+ statement below).
#
# Copy this file to /etc/udev/rules.d/51-android.rules then run the following lines
# sudo chmod a+r /etc/udev/rules.d/51-android.rules
# sudo /etc/init.d/udev restart
@xgouchet
xgouchet / menurc
Created February 16, 2015 16:19
A Gimp shortcup preference file to mimic Photoshop shortcuts
; This file installs keyboard shortcuts from Photoshop 6 in GIMP 2.8.
;
; Rename it to 'menurc' and place it into your personal GIMP directory:
; ~/.gimp-2.8 folder (Linux)
;
;
(gtk_accel_path "<Actions>/view/view-shrink-wrap" "")
(gtk_accel_path "<Actions>/plug-in/plug_in_iwarp" "<Primary><Shift>x")
(gtk_accel_path "<Actions>/layers/layers-duplicate" "<Primary>j")
(gtk_accel_path "<Actions>/plug-in/plug_in_c_astretch" "<Primary><Shift><Alt>l")
@xgouchet
xgouchet / sessionrc
Last active August 29, 2015 14:15
A gimp layout preference file to mimic Photoshop's layout
; This file installs layout preferences from Photoshop 6 in GIMP 2.8.
;
; Rename it to 'sessionrc' and place it into your personal GIMP directory:
; ~/.gimp-2.8 folder (Linux)
;
;
(session-info "toplevel"
(factory-entry "gimp-empty-image-window")
(position 195 356)
@xgouchet
xgouchet / .gitattributes
Created April 16, 2015 06:57
A Git attributes, used to specify diff commands for specific file types
*.gif diff=image
*.jpg diff=image
*.png diff=image
@xgouchet
xgouchet / git-imgdiff
Created April 16, 2015 07:05
A tool to show image changes in git diff
#!/bin/sh
# this uses ImageMagick, so make sure it's installed for this to work
compare $2 $1 png:- | montage -geometry +4+4 $2 - $1 png:- | display -title "$1" -

Keybase proof

I hereby claim:

  • I am xgouchet on github.
  • I am xgouchet (https://keybase.io/xgouchet) on keybase.
  • I have a public key whose fingerprint is 35B2 0154 3D41 A27E 2DBA 7C6E 7650 A508 4AB6 4CD6

To claim this, I am signing this object: