Skip to content

Instantly share code, notes, and snippets.

View elebescond's full-sized avatar

LE BESCOND Erwan elebescond

View GitHub Profile
@elebescond
elebescond / Javascript ISO country code to country name conversion
Last active August 29, 2015 14:27 — forked from maephisto/Javascript ISO country code to country name conversion
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
git remote show origin
git checkout --track -b branch_name origin/branch_name
or
git checkout -t origin/branch_name
git remote show origin
@elebescond
elebescond / gist:3090789
Created July 11, 2012 14:37
replace url in wordpress post content
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://oldlink.com', 'http://newlink.com');
@elebescond
elebescond / .gitignore
Created January 30, 2012 08:38
gitignore for eclipse grails project
*.iws
*Db.properties
*Db.script
.settings
eclipse
grails-app/conf/DataSource.groovy
stacktrace.log
target
target-eclipse
/plugins
majewan@majewan:/tmp$ wget http://www.les-horaires.fr/go/130
–2012-01-02 12:17:30– http://www.les-horaires.fr/go/130
Résolution de www.les-horaires.fr… 91.121.110.157
Connexion vers www.les-horaires.fr|91.121.110.157|:80… connecté.
requête HTTP transmise, en attente de la réponse… 302 Moved Temporarily
Emplacement: http://ad.zanox.com/ppc/?13566869C1968578671T [suivant]
–2012-01-02 12:17:30– http://ad.zanox.com/ppc/?13566869C1968578671T
Résolution de ad.zanox.com… 217.110.110.231
Connexion vers ad.zanox.com|217.110.110.231|:80… connecté.
requête HTTP transmise, en attente de la réponse… 302 Moved Temporarily
@elebescond
elebescond / gist:1472310
Created December 13, 2011 14:31
Module git
git submodule add git://github.com/xxx/yyy.git yyy
@elebescond
elebescond / gist:1433137
Created December 5, 2011 10:24
Generate a pot template from a wordpress theme - xgettext
find . -iname "*.php" > /tmp/my_theme_file_list.txt
# new template
xgettext --from-code=utf-8 -d my_theme -f /tmp/my_theme_file_list.txt --keyword=__ -o languages/my_theme.pot
# update template
xgettext --from-code=utf-8 -d my_theme -j -f /tmp/my_theme_file_list.txt --keyword=__ -o languages/my_theme.pot
@elebescond
elebescond / gist:1432910
Created December 5, 2011 08:51
Equivalent du svn revert avec git
Par fichier:
svn revert path/to/file ==> git checkout path/to/file
Working copy
git reset --hard
@elebescond
elebescond / screen_memo.txt
Created November 29, 2011 09:35
screen memo
elebescond@elebescond:~$ screen bash
press CTRL+A followed by d to detach the screen.
[detached from 5883.pts-1.elebescond]
elebescond@elebescond:~$ screen -ls
There is a screen on:
5883.pts-1.elebescond (29/11/2011 10:23:02) (Detached)
1 Socket in /var/run/screen/S-elebescond.
elebescond@elebescond:~$ screen -r 5883.pts-1.elebescond
elebescond@elebescond:~$ screen -d 5883.pts-1.elebescond
@elebescond
elebescond / gist:1336580
Created November 3, 2011 14:14
Wordpress how to register admin options
<?php
add_action( 'admin_init', 'myplugin_admin_init' );
function myplugin_admin_init() {
//register settings
register_setting( 'myplugin_options_group1', 'myplugin_option_1' );
}
// create custom plugin settings menu