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 / new_gist_file
Created September 9, 2013 15:22
Url getters in jQuery
http://www.refulz.com:8082/index.php#tab2?foo=123
Property Result
-------------------------------------------
host www.refulz.com:8082
hostname www.refulz.com
port 8082
protocol http
pathname index.php
@lmeyer
lmeyer / gist:8158267
Created December 28, 2013 10:58
CLI Progress Bar
function show_status($done, $total, $size=30) {
static $start_time;
// if we go over our bound, just ignore it
if($done > $total) return;
if(empty($start_time)) $start_time=time();
$now = time();
@lmeyer
lmeyer / gist:8186263
Created December 30, 2013 18:54
See what ports are used windows
C:\> netstat -a -b
@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'));
@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 / 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 / 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 / gist:098a612424d5114cb3ab
Created November 30, 2015 11:41
Login when "this account is not available"
su -l apache -s /bin/bash
@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 / 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';