Skip to content

Instantly share code, notes, and snippets.

View fxthomas's full-sized avatar

François-Xavier Thomas fxthomas

  • DxOMark Image Labs
  • Paris
View GitHub Profile
#!/usr/bin/python
# coding=utf-8
from gi.repository import GObject
import sys
import dbus
import smtplib
import subprocess
from datetime import datetime
from dbus.mainloop.glib import DBusGMainLoop
@fxthomas
fxthomas / build.scala
Created September 8, 2013 13:01
Build.scala for libgdx-sbt-project and sbt-android 0.7 (with working tests)
import sbt._
import Keys._
import org.scalasbt.androidplugin._
import org.scalasbt.androidplugin.AndroidPlugin._
import sbtassembly.Plugin._
import AssemblyKeys._
object Settings {
lazy val scalameter = new TestFramework("org.scalameter.ScalaMeterFramework")
@fxthomas
fxthomas / build.scala
Created May 28, 2013 20:52
Build.scala for https://bitbucket.org/j1m/hipain and SBT-Android 0.7-SNAPSHOT
import sbt._
import Keys._
import org.scalasbt.androidplugin.AndroidPlugin._
object General {
// Some basic configuration
val settings = Seq (
name := "HiPain",
version := "0.1",
@fxthomas
fxthomas / patch.diff
Created May 17, 2013 14:48
Android patch for IntelliJ projects generated by sbtidea
diff -rupN original/.idea/modules.xml modified/.idea/modules.xml
--- original/.idea/modules.xml 2013-05-17 16:27:19.000000000 +0200
+++ modified/.idea/modules.xml 2013-05-17 16:41:26.000000000 +0200
@@ -1,9 +1,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
- <module fileurl="file://$PROJECT_DIR$/.idea_modules/main-build.iml" filepath="$PROJECT_DIR$/.idea_modules/main-build.iml" ></module>
<module fileurl="file://$PROJECT_DIR$/.idea_modules/main.iml" filepath="$PROJECT_DIR$/.idea_modules/main.iml" ></module>
- <module fileurl="file://$PROJECT_DIR$/.idea_modules/tests.iml" filepath="$PROJECT_DIR$/.idea_modules/tests.iml" ></module>
@fxthomas
fxthomas / .tmux.conf
Created April 9, 2013 12:13
Tmux Configuration
set -g prefix C-b
set -g default-terminal "screen-256color"
set -g history-limit 20000
setw -g automatic-rename
setw -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g bell-action any
set-option -g visual-bell off
# Relax!
@fxthomas
fxthomas / Advanced-settings.md
Last active August 3, 2016 09:17
SBTEclipse wiki entry about changing project description files

Changing project files

Eclipse .project and .classpath files are XML files, and you can hook into sbteclipse's generation process by using the classpathTransformerFactories and projectTransformerFactories setting keys.

(The following Scala samples should be inside your project's Build.scala file, or a plugin)

Let's say we want to add the com.example.nature nature to our project. The

@fxthomas
fxthomas / osx-tunnel.sh
Created November 26, 2012 20:17
Automatic tunnel for Mac OSX
#!/bin/bash
function enable_proxy {
echo "Enabling SOCKS proxy to localhost:8080"
networksetup -setsocksfirewallproxy wi-fi localhost 9999
}
function disable_proxy {
echo "Disabling SOCKS proxy"
networksetup -setsocksfirewallproxystate wi-fi off
@fxthomas
fxthomas / test.py
Created May 22, 2012 23:05
Quick NumPy usage example
#!/usr/bin/python
# coding=utf-8
# Import everything you need for image processing
from pylab import *
# This is an addon that's needed to be able to save the image
from scipy.misc import imsave
# Read image called "input.jpg" (rename that to whatever you want)
@fxthomas
fxthomas / ilocalize.py
Created May 7, 2012 10:32
iLocalize -- Xcode project localizer
#!/usr/bin/python
# coding=utf-8
# Base Python File (ilocalize.py)
# Created: Sun May 6 11:18:15 2012
# Version: 1.0
#
# This Python script was developped by François-Xavier Thomas.
# You are free to copy, adapt or modify it.
# If you do so, however, leave my name somewhere in the credits, I'd appreciate it ;)
@fxthomas
fxthomas / test.lua
Created February 20, 2012 17:50
Lua Test
-- Test LUA lesson
function main ()
image_params = {
id = "equerre",
type = "image",
params = {
filename = "Bubble.png",
movable = false
}