Skip to content

Instantly share code, notes, and snippets.

View lmeyer's full-sized avatar
🍷
Working full-time for @winesitting

Ludovic Meyer lmeyer

🍷
Working full-time for @winesitting
View GitHub Profile
@lmeyer
lmeyer / gist:4125798
Created November 21, 2012 16:21
Validateur Symfony ne matchant pas avec une regexp
$this->validatorSchema['username'] = new sfValidatorEmail(
array('trim' => true, 'must_match' => false, 'min_length' => 3, 'max_length' => 50),
array('messages d erreurs')
);
@lmeyer
lmeyer / maj_vhost
Created November 21, 2012 16:23
MAJ plesk des vhosts.conf
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com
@lmeyer
lmeyer / gist:4125820
Created November 21, 2012 16:24
Replace in mysql
UPDATE `wp_24_posts` SET `guid` = REPLACE(`guid`, "http://olddomain.com/", "http://newdomain.com/")
@lmeyer
lmeyer / gist:4125841
Created November 21, 2012 16:26
Detect user IP throught load balancer
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])){
$hostname=$_SERVER["HTTP_X_FORWARDED_FOR"] . ' via ' . $_SERVER["REMOTE_ADDR"];
$hostname=$_SERVER["HTTP_X_FORWARDED_FOR"];
} else {
$hostname=$_SERVER["REMOTE_ADDR"];
}
@lmeyer
lmeyer / gist:4128538
Created November 21, 2012 23:31
Mouse click and hold event
var intervalId;
var i = 0;
$("#element").mousedown(function(e) {
intervalId = setInterval(function(){
console.log(i++);
}, 10);
}).mouseup(function() {
clearInterval(intervalId);
i = 0;
});
@lmeyer
lmeyer / .gitconfig
Created December 18, 2012 15:41
Global Git configuration and aliases
[user]
name = Ludovic Meyer
email = [email protected]
[core]
autocrlf = false
safecrlf = false
[merge]
summary = true
log = true
[alias]
@lmeyer
lmeyer / gist:4500868
Last active December 10, 2015 22:18
Symlink example for windows
In Git Bash :
$ ln -s /d/Google\ Drive/Work/mistral/wordpress/wp-content/blogs.dir/ wp-content/blogs.dir
or
$ cmd
$ mklink /D wp-content\blogs.dir "D:\Google Drive\Work\mistral\wordpress\wp-content\blogs.dir"
In cmd :
$ mklink /D wp-content\blogs.dir "D:\Google Drive\Work\mistral\wordpress\wp-content\blogs.dir"
@lmeyer
lmeyer / gist:4507048
Created January 11, 2013 00:40
Creative CSS font stacks optimized for titles and body text
/*
http://snipplr.com/view/7143/creative-css-font-stacks-optimized-for-titles-and-body-text/
*/
.arial{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;}
p.baskerville{font-family:Baskerville,"Times New Roman",Times,serif;}
.title.baskerville{font-family:Baskerville,Times,"Times New Roman",serif;}
.cambria{font-family:Cambria,Georgia,Times,"Times New Roman",serif;}
.century{font-family:"Century Gothic","Apple Gothic",sans-serif;}
.consolas{font-family:Consolas,"Lucida Console",Monaco,monospace;}
@lmeyer
lmeyer / colors.less
Last active December 16, 2015 21:28
Pixel Cookers Redmine Theme configurations
@linkColor: #4396CE;
@topMenuBackground: #222;
@topMenuBorderColor: #235F87;
@topMenuLinkColor: #DDD;
@topMenuLinkColorHover: #FFF;
@headerBackground: #4496CE;
@headerLinkColor: #EEE;
@headerLinkColorHover: #FFF;
@lmeyer
lmeyer / new_gist_file
Created September 7, 2013 15:36
Fix the ugly font rendering in Google Chrome
-webkit-text-stroke: 0.3px;