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:b98bdda9237e43179019c84c9de20771
Created October 10, 2016 09:55
Javascript page redirection difference
// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");
// similar behavior as clicking on a link
window.location.href = "http://stackoverflow.com";
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2015-10-12 19:24+0200\n"
"PO-Revision-Date: 2015-10-12 19:35+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@lmeyer
lmeyer / gist:fddd7333aba1b076f17cce8d5e4ddbf4
Created August 1, 2016 11:14
Sync local folder with FTP
ncftpput -R -u user -p pass ftp.domain.com remote_dir local_dir
-z to incremental
@lmeyer
lmeyer / file.sh
Last active April 24, 2016 12:59
View and enable mySQL logs
mysql> SHOW VARIABLES LIKE "general_log%";
+------------------+----------------------------+
| Variable_name | Value |
+------------------+----------------------------+
| general_log | OFF |
| general_log_file | /var/run/mysqld/mysqld.log |
+------------------+----------------------------+
mysql> SET GLOBAL general_log = 'ON';
@lmeyer
lmeyer / gist:f12170b46e254caa0c4320c9ae455880
Last active April 24, 2016 12:53
Display SQL queries that need to be run to convert myISAM to InnoDB
SELECT CONCAT('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE='MyISAM'
AND table_schema = 'mydatabase';
@lmeyer
lmeyer / gist:098a612424d5114cb3ab
Created November 30, 2015 11:41
Login when "this account is not available"
su -l apache -s /bin/bash
@lmeyer
lmeyer / base
Last active November 15, 2023 12:46
Boxstarter
#######################
# Windows Configuration
Update-ExecutionPolicy Unrestricted
Disable-InternetExplorerESC
Disable-GameBarTips
Disable-BingSearch
Enable-RemoteDesktop
Enable-MicrosoftUpdate
@lmeyer
lmeyer / gitcam.sh
Created September 25, 2014 19:42
Gitshots for Windows - Gitcam
#!/bin/sh
### gitcam for windows (start) ###
NAME=`date +%Y%m%d%H%M%S`
DIRECTORY="/IMAGES/TARGET/DIRECTORY"
COMMANDCAMDIR="/PATH/TO/COMMANDCAM"
BMP2JPGDIR="/PATH/TO/BMP2PG"
if [ ! -d "$DIRECTORY" ]; then
mkdir $DIRECTORY
fi
@lmeyer
lmeyer / gist:b7a959542f17152efcb8
Created May 23, 2014 13:19
Build propel model when propel-gen throw phing.php : permission denied
php vendor/propel/propel1/generator/bin/phing.php -f "vendor/propel/propel1/generator/build.xml" -Dproject.dir=app/config/propel main
@lmeyer
lmeyer / gist:9451321
Created March 9, 2014 17:34
Generate random date between two dates
<?php
date('Y-m-d H:i:s' ,rand(strtotime('now'), strtotime('+ 20 days')));
date('Y-m-d H:i:s', strtotime( '-'.mt_rand(0,3888000).' seconds'));
date('Y-m-d', strtotime( '+'.mt_rand(0,30).' days'));