View restbash
#!/usr/bin/env bash
# Usage: {script} SCRIPT
#
# --dry-run Displays the request but doesn't not perform it.
#
# Report bugs to Henrique Moody <henriquemoody@gmail.com>
#
if [[ -z "${1}" ]] || [[ ! -f "${1}" ]]; then
sed -E 's/^#\s?(.*)/\1/g' "${0}" |
View br-cities.php
<?php
return [
// http://www.cidades.ibge.gov.br/download/mapa_e_municipios.php?uf=ac (Thu May 14 16:30:15 BRT 2015)
'AC' => [
1200013 => 'Acrelândia',
1200054 => 'Assis Brasil',
1200104 => 'Brasiléia',
1200138 => 'Bujari',
1200179 => 'Capixaba',
View country-subdivision.bash
#!/usr/bin/env bash
set -e
DIRECTORY=$(dirname "${BASH_SOURCE}")
URL="${1}"
ENTRY=$(echo "${1}" | cut -d '/' -f 4)
FILE_HTML="${DIRECTORY}/html/${ENTRY}.html"
FILE_TEXT="${DIRECTORY}/text/${ENTRY}.text"
View mysql_backup.bash
#!/usr/bin/env bash
set -e
DATE_FORMAT="%Y-%m-%d"
DATE_CREATION=$(date "+${DATE_FORMAT}")
DATE_REMOVAL=$(date -d "20 day ago" "+${DATE_FORMAT}")
DIRECTORY_BASE="/backup/mysql"
DIRECTORY_CREATION="${DIRECTORY_BASE}/${DATE_CREATION}"
View HttpException.php
<?php
class HttpException extends \Exception
{
/**
* List of additional headers
*
* @var array
*/
private $headers = array();
View gist:6580488
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
**/
return array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing', // WebDAV; RFC 2518
200 => 'OK',
View nl_langinfo.php
<?php
$langinfo = array(
'LC_TIME' => array(
'ABDAY_1' => 'Abbreviated name of fist day of the week',
'ABDAY_2' => 'Abbreviated name of second day of the week',
'ABDAY_3' => 'Abbreviated name of third day of the week',
'ABDAY_4' => 'Abbreviated name of fourth day of the week',
'ABDAY_5' => 'Abbreviated name of fifth day of the week',
'ABDAY_6' => 'Abbreviated name of sixth day of the week',
View git-branch-authors.sh
#!/usr/bin/env bash
MAX_LENGTH=0
DIRNAME="$(git rev-parse --show-toplevel)/.git/refs/heads"
for file_name in "${DIRNAME}"/*; do
length=$(basename "${file_name}" | wc -c | awk '{print $1}')
if [[ ${length} -gt ${MAX_LENGTH} ]]; then
MAX_LENGTH=${length}
fi
done;
View AbstractEnum.php
<?php
abstract class AbstractEnum
{
/**
* @var string
*/
private $name;
View php-remove-commented-code.bash
#!/usr/bin/env bash
# Usage: {script} DIRECTORY
# Find PHP's commented code and remove then.
#
# --help, -h Displays this help
#
# Report bugs to Henrique Moody <henriquemoody@gmail.com>
#
declare -r SCRIPT_NAME=$(basename ${0})