Skip to content

Instantly share code, notes, and snippets.

View ebouchut's full-sized avatar

Eric Bouchut ebouchut

View GitHub Profile
@ebouchut
ebouchut / gist:6699245
Created September 25, 2013 13:01
Javascript regex to test if a language code is RFC5646 compliant [locale] [I18N]
private static RegExp buildRegexpLangRfc5646()
{
String extLang = "([A-Za-z]{3}(-[A-Za-z]{3}){0,2})";
String language =
"(([a-zA-Z]{2,3}(-" + extLang + ")?)|([a-zA-Z]{5,8}))";
String script = "([A-Za-z]{4})";
String region = "([A-Za-z]{2}|\\d{3})";
String variant = "([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))";
String singleton = "(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])";
String extension = "(" + singleton + "(-[A-Za-z0-9]{2,8})+)";
@ebouchut
ebouchut / gist:4130048
Created November 22, 2012 08:48 — forked from canton7/gist:1053846
git push, tracking, and push.default

git clone path/to/test/repo.git

push.default = matching (the default)

git config push.default matching

git branch -a
   * master
@ebouchut
ebouchut / 0main.md
Created November 21, 2012 12:33 — forked from canton7/0main.md
Local versions of tracked config files

How to have local versions of tracked config files in git

This is a fairly common question, and there isn't a One True Answer.

These are the most common techniques:

If you can modify your application

@ebouchut
ebouchut / GwtChosen-ChromeWidthIssue.png
Created November 15, 2012 16:28
gwt-chosen issue26: ChosenListBox is too narrow on Chrome (optgroups wrap right)
GwtChosen-ChromeWidthIssue.png
@ebouchut
ebouchut / gist:3162811
Created July 23, 2012 09:32
Make Iceweasel the default browser (of Kopete and other programs like hotot)
System
Preferences
System Configuration
File Associations
text /html
Move "Iceweasel" to the top of the list
Personal
Default Applications
Web Browser
Tick "In an application based on the content of the URL"
@ebouchut
ebouchut / gist:2005690
Created March 9, 2012 08:45
Print the fingerprint of a public key
ssh-keygen -lf ~/.ssh/id_rsa.pub
1024 43:28:56:7f:21:93:02:04:56:af:5f:cb:55:45:e1:67 /users/username/.ssh/id_rsa.pub (DSA)
@ebouchut
ebouchut / gist:1815764
Created February 13, 2012 10:13
Select a tags without a title attribute using CSS
a:not([title])
@ebouchut
ebouchut / gist:1510447
Created December 22, 2011 14:18
(Sass/maven) Unable to launch rake using jruby-rake-plugin
java -jar ~/.m2/repository/org/jruby/jruby-complete/1.6.5/jruby-complete-1.6.5.jar -S gem env
@ebouchut
ebouchut / PrintStackTraceInAString
Created November 14, 2011 13:54
Print a StackTrace in a String
StringWriter writer = new StringWriter();
e.printStackTrace(
new PrintStream(
new WriterOutputStream(
new PrintWriter(writer)
)
)
);