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
/** | |
* Implementação de Registry em javascript. | |
* | |
* @author Henrique Moody | |
*/ | |
var Registry = new function Registry () { | |
// Dados no registry | |
var _data = new Array(); |
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 | |
oldName=$1 | |
newName=$2 | |
pattern="(new|class|extends|interface|implements) +(\b${oldName}\b)"; | |
egrep -i "${pattern}" -Rn --include=*.php --exclude=*.svn* . | cut -d':' -f1 | sort | uniq | xargs sed -ri "s/${pattern}/\1 ${newName}/gi"; | |
pattern="(\b${oldName}\b)::"; | |
egrep -i "${pattern}" -Rn --include=*.php --exclude=*.svn* . | cut -d':' -f1 | sort | uniq | xargs sed -ri "s/${pattern}/${newName}::/gi"; |
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("sqlite:/tmp/pdo.db"); | |
$attributes = array( | |
"AUTOCOMMIT", | |
"ERRMODE", | |
"CASE", | |
"CLIENT_VERSION", | |
"CONNECTION_STATUS", | |
"ORACLE_NULLS", | |
"DRIVER_NAME", |
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
var Watcher = function () | |
{ | |
var _interval = 1000; | |
var _running = false; | |
var _callback = function () | |
{ | |
// Just a callback |
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 | |
/** | |
* @param string $string | |
* @param string $separator | |
* @return string | |
*/ | |
function camelCaseToSeparator($string, $separator = '-') | |
{ | |
return preg_replace('/(?<=[a-z])([A-Z])/', $separator . '$1', $string); |
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} ENTITY | |
# | |
declare ENTITIES=${1} | |
find_entity() | |
{ | |
local entity=${1} | |
local spaces="${2}" |
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 | |
HELP="Usage: $(basename ${0}) DIR | |
or: $(basename ${0}) --help | |
Find all occurrences of the files of DIR into other files and delete then if | |
there is no occurrence. | |
--help display this help and exit | |
Exemplos: |
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 | |
for file in *; | |
do | |
link=$(readlink "${file}"); | |
if [ "${link}" ] | |
then | |
rm "${file}"; | |
cp -v "${link}" "${file}"; | |
fi; | |
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
#!/usr/bin/env bash | |
# Usage: {script} [--debug|-d] DIRECTORY [ PREFIX ] | |
# | |
# --debug, -d Run script in debug mode | |
# --help, -h Displays this help | |
# | |
# Report bugs to Henrique Moody <[email protected]> | |
# | |
declare DEBUG_MODE=0 |
OlderNewer