This file contains hidden or 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 | |
function json_decode_nice($json, $assoc = FALSE){ | |
$json = str_replace(array("\n","\r"),"",$json); | |
$json = preg_replace('/([{,]+)(\s*)([^"]+?)\s*:/','$1"$3":',$json); | |
$json = preg_replace('/(,)\s*}$/','}',$json); | |
return json_decode($json,$assoc); | |
} | |
// Example: |
This file contains hidden or 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 # Add the following to config.inc.php | |
$cfg['Export']['sql_drop_database'] = true; | |
$cfg['Export']['sql_drop_table'] = true; | |
$cfg['Export']['compression'] = 'zip'; |
This file contains hidden or 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 -exec chmod 775 {} \; | |
find . -type f -exec chmod 664 {} \; |
This file contains hidden or 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
# textutil -convert html file.doc -stdout | pandoc -f html -t markdown -o file.md | |
see also: https://gist.github.com/2380036 | |
This file contains hidden or 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/sh | |
# A shell script that tries its best to convert documents thrown at it | |
# to pandoc's extended markdown. | |
# | |
# Depends on: | |
# | |
# + textutil: an OS X only command line utility | |
# + odt2pandoc.py: a tweaked version of odt2txt.py | |
# + pdftohtml: a utility for converting pdf to html |
This file contains hidden or 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
// Lists of countries with ISO 3166 codes, presented in various formats. | |
// Last Updated: July 30, 2020 | |
// If you're using PHP, I suggest checking out: | |
// https://github.com/thephpleague/iso3166 | |
// or Laravel: https://github.com/squirephp/squire | |
// | |
// JS developers can check out: | |
// https://www.npmjs.com/package/iso3166-2-db | |
// |
NewerOlder