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
# Все команды рассчитаны на мак | |
function dc-clear-logs { | |
SERVICENAME=$1 | |
CONTAINER=$(docker-compose ps "$SERVICENAME" | grep "$SERVICENAME" | awk '{ print $1 }') | |
LOGPATH=$(docker inspect --format='{{.LogPath}}' "$CONTAINER") | |
echo 'echo "" > '"$LOGPATH" > ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty | |
} | |
function git-sync-branch { |
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
hub: | |
image: selenium/hub | |
ports: | |
- 4444:4444 | |
chrome: | |
image: selenium/node-chrome-debug | |
links: | |
- hub:hub | |
ports: |
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
RewriteCond %{HTTP:X-Forwarded-Port} !=443 | |
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] |
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
if ($request_method = GET) { | |
set $test A; | |
} | |
if ($http_cookie !~* "auth_token") { | |
set $test "${test}B"; | |
} | |
if ($test = AB) { | |
return 418; |
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
Interactive shell | |
php > class A { public $i = 3; public function __toString() { return $this->i; } } | |
php > $a = new A(); | |
php > echo "$a" + 2; | |
PHP Catchable fatal error: Method A::__toString() must return a string value in php shell code on line 1 | |
php > $a->i = '3'; | |
php > echo "$a" + 2; | |
5 | |
php > |
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 -a | |
php > define('true', false); | |
PHP Notice: Constant true already defined in php shell code on line 1 | |
php > define('TRUE', false); | |
php > echo true; | |
1 | |
php > echo TRUE; | |
php > | |
$ php -r 'define("TRUE", "asd");echo TRUE;' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Singleton Example</title> | |
</head> | |
<body> | |
<script> | |
// one way to create Singleton | |
console.log('first way:'); |
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 | |
class Polygon { | |
/** | |
* @var array | |
*/ | |
protected $polygon = []; | |
/** | |
* Polygon itself, with basic vector-based structure |