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 | |
$str = $_REQUEST['body']; | |
for ($i = 0; $i < strlen($str); $i++) { | |
$byte = $str[$i]; | |
if (ord($byte) > 127) { | |
$output .= "\\x" . bin2hex($byte); | |
} else { |
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
find . -type d -name .svn -print0 | xargs -0 rm -rf |
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 | |
error_reporting(E_ALL & ~E_NOTICE | E_STRICT); // (Show all errors, except for notices) | |
$sag_supported = E_ALL ^ E_NOTICE; | |
$current = error_reporting(); | |
var_dump($current > $sag_supported || $current < 0); // true | |
var_dump(($current & E_NOTICE) > 0); // false |
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
DVDDIR=$1 | |
OUTDIR=`dirname "$DVDDIR"` | |
DVDNAME=`basename "$DVDDIR"` | |
hdiutil makehybrid -udf -udf-volume-name "$DVDNAME" -o "$OUTDIR/$DVDNAME.iso" "$DVDDIR" |
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
SELECT DISTINCT column1 FROM table GROUP BY column1 HAVING COUNT(column1) > 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 | |
basename=`basename $1` | |
dir=${basename%.*} | |
mkdir -p "$dir" | |
output=`swfextract "$1" | grep "Sounds:"` | |
echo "${output:23}" | tr "," "\n" | while read word; do | |
swfextract -s $word "$1" -o "$dir/$word.mp3" | |
done |
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 | |
$gzp = gzopen('feed.xml.gz', 'r'); | |
$fp = fopen('feed.xml', 'w'); | |
while (!gzeof($gzp)) { | |
fwrite($fp, gzgets($gzp, 4096)); | |
} | |
fclose($fp); |
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
{% macro vhost(name, server_name, config={}) %} | |
{% set defaults = { 'server_name': server_name } %} | |
{% do defaults.update(config) %} | |
{{ name }}: | |
file.managed: | |
- template: jinja | |
- source: salt://nginx/site.conf | |
- defaults: {{ defaults }} | |
{% endmacro %} |
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
Log from Sensiolabs Insight when it tried to install dependencies: | |
--------------------- | |
<warn>The "puli"/"puli.phar" command could not be found.</warn> | |
Loading composer repositories with package information | |
Installing dependencies (including require-dev) from lock file | |
[...] | |
Generating optimized autoload files |
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
# deb http://mirror.transip.net/ubuntu/ubuntu wily main restricted | |
# deb http://mirror.transip.net/ubuntu/ubuntu wily-updates main restricted | |
# deb http://security.ubuntu.com/ubuntu wily-security main restricted | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://mirror.transip.net/ubuntu/ubuntu wily main restricted | |
deb-src http://mirror.transip.net/ubuntu/ubuntu wily main restricted |
OlderNewer