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 | |
class Tweet | |
{ | |
private $id; | |
private $content; | |
public function __construct(int $id, string $content) | |
{ | |
$this->id = $id; |
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 | |
/** | |
* Создает подготовленное выражение на основе готового SQL запроса и переданных данных. | |
* | |
* @param mysqli $link Ресурс соединения | |
* @param string $sql SQL запрос с плейсхолдерами вместо значений | |
* @param array $data Данные для вставки на место плейсхолдеров | |
* | |
* @throws \UnexpectedValueException Если тип параметра не поддерживается |
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
#!/usr/bin/env sh | |
remote_url='https://webdav.yandex.ru/backups' | |
credentials=$(cat ~/.yapwd) # user:password | |
curl_command="curl -u $credentials" | |
create_remote_dir() { | |
$curl_command -X MKCOL "$remote_url/$1" | |
return $? |
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
#!/usr/bin/env bash | |
# | |
# Launch this script in a new Joomla folder | |
# | |
current_dir=$(readlink -f .) | |
if [[ ! -w $current_dir/configuration.php ]]; then | |
echo "Error: configuration.php isn't writable or doesn't exists" 1>&2 | |
exit 1; |
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
#!/usr/bin/env sh | |
# | |
# Launch this script in a new MODx directory | |
# | |
old_path=$(sed -ne "s/^.*\\\$modx_base_path[[:space:]]*=[[:space:]]*'\\(.*\\)';.*$/\\1/p" core/config/config.inc.php) | |
new_path=$(readlink -f ${2:="."} 2&>/dev/null) | |
for file in $(grep -lR --exclude-dir="cache" $old_path * 2&> /dev/null) |
NewerOlder