This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @Sensio\Insight\Ignore("unused_parameter", comment="$k representent the key in the callback") | |
*/ | |
each([1, 2, 3], function($k, $v) { | |
echo $v; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
siege -H 'Accept-Encoding: gzip' -q -b -r 10 -c 10 http://www.wemakecustom.com/js/jquery.min.js | |
Transactions: 100 hits | |
Availability: 100.00 % | |
Elapsed time: 2.59 secs | |
Data transferred: 2.79 MB | |
Response time: 0.23 secs | |
Transaction rate: 38.61 trans/sec | |
Throughput: 1.08 MB/sec | |
Concurrency: 8.87 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# @link https://gist.github.com/lavoiesl/11022278 | |
VERBOSE=0 | |
if [ "$1" = "-v" ]; then | |
VERBOSE=1 | |
shift | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php -q | |
<?php | |
/** | |
* @link https://gist.github.com/lavoiesl/11023566 | |
*/ | |
$error = function($msg, $code = 1) { | |
file_put_contents('php://stderr', $msg . PHP_EOL); | |
exit($code); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Generates a random password using only non-ambiguous alphanumeric characters | |
# Usage: genpasswd.sh [length] | |
# | |
# @link https://gist.github.com/lavoiesl/11023640 | |
length=16 | |
if [[ -n "$1" ]]; then | |
length="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to remove temporary and junk files from Windows and OS X | |
# @link https://gist.github.com/lavoiesl/11023700 | |
### Not set up to run as root. Advised not to do this. ### | |
#### Variables #### | |
# Files to remove (Add others, just remember to increment the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Convert file from iso-8859-* to UTF8 if needed | |
if [[ $# -lt 1 ]]; then | |
echo "Usage: $0 input-file" >&2 | |
exit 1 | |
fi | |
mime_encoding="$(file -b --mime-encoding "$1")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Extra configuration | |
; priority=50 | |
allow_url_fopen = On | |
allow_url_include = Off | |
auto_detect_line_endings = On | |
date.timezone = 'America/Montreal' | |
default_charset = "utf-8" | |
default_mimetype = "text/html" | |
default_socket_timeout = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// $pdo = new PDO(...) | |
$charsets = array('UTF-8', 'ISO-8859-1'); | |
$tables = array( | |
'events' => array( | |
'title', | |
'description', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Drop all tables of a MySQL database | |
# https://gist.github.com/lavoiesl/96aa8586b609daac2dad | |
if [ -z "$@" ]; then | |
echo "Usage: $0 database_name" >&2 | |
echo " or : $0 -uuser -ppassword -hlocalhost database_name" >&2 | |
exit 1 | |
fi |
OlderNewer