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 | |
# 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}) |
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 | |
# Uses script and scriptreplay to record and playback virtual terminal. | |
# Copyright (C) 2007 Hean Kuan Ong <mysurface@gmail.com> | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
declare -A REFERENCES | |
while read filename; do | |
declare rule=$(cut -d '/' -f 2 <<< "${filename}" | cut -d '.' -f 1) | |
declare related_rules=$( | |
egrep '\[.+\]\(.+\.md\)' "${filename}" | | |
sed -E 's,.*\[.+\]\((.+)\.md\).*,\1,' | | |
egrep -v '(ComparableValues|BaseAccount|Vxdigit)' | |
) | |
for related_rule in ${related_rules}; do |
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 | |
// Based on https://stackoverflow.com/questions/965611/forcing-access-to-php-incomplete-class-object-properties | |
function convertObject($object, string $from, string $to) | |
{ | |
// Serialize | |
$serialized = serialize($object); | |
// Replace the object-type | |
$objectReplaced = preg_replace( |
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 | |
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}" |
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 | |
set -e | |
declare DIRECTORY=$(dirname "${BASH_SOURCE}") | |
declare URL="${1}" | |
declare ENTRY=$(echo "${1}" | cut -d '/' -f 4) | |
declare FILE_HTML="${DIRECTORY}/html/${ENTRY}.html" | |
declare FILE_TEXT="${DIRECTORY}/text/${ENTRY}.text" |
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 | |
$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', |
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 | |
abstract class AbstractEnum | |
{ | |
/** | |
* @var string | |
*/ | |
private $name; |