Skip to content

Instantly share code, notes, and snippets.

Nicolas Cornette ncornette

  • Paris
Block or report user

Report or block ncornette

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ncornette / KotlinTimeUnitTest.kt
Last active Jan 29, 2018
Kotlin extension functions for java TimeUnit
View KotlinTimeUnitTest.kt
package utils
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import java.util.concurrent.TimeUnit
class KotlinTimeUnitTest(private val timeValue: Long) {
ncornette / Default for XWin FR.xml
Last active Apr 2, 2017
IntelliJ keymap for FR keyboard layout with alt+[1-9] key bindings
View Default for XWin FR.xml
<keymap version="1" name="Default for XWin FR" parent="Default for XWin">
<action id="ActivateAndroidMonitorToolWindow">
<keyboard-shortcut first-keystroke="alt 6" />
<keyboard-shortcut first-keystroke="alt minus" />
<action id="ActivateChangesToolWindow">
<keyboard-shortcut first-keystroke="alt 9" />
<keyboard-shortcut first-keystroke="alt #10000c7" />
<action id="ActivateDebugToolWindow">
ncornette /
Created Nov 19, 2015
Command to find unused layouts in android project
# 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"
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() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return null;
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;
ncornette / gist:77fdf6ee4777965813d4
Created Feb 19, 2015
Git track all remote branches
View gist:77fdf6ee4777965813d4
#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
#!/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 ''
win = gtk.Window()
ncornette / .xinitrc
Created Dec 4, 2014
.xinitrc for kiosk mode
View .xinitrc
# 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
ncornette /
Last active Dec 6, 2016
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 /
Created Aug 20, 2012
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>"
You can’t perform that action at this time.