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 | |
/** | |
* Person | |
*/ | |
class Person extends BadPerson | |
{ | |
public $firstname; | |
public $lastname; | |
public $isGoodPerson; | |
function __construct($firstname,$lastname,$isGoodPerson = false) |
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
{ "keys": ["k"], "command": "set_motion", "args": { | |
"motion": "move", | |
"motion_args": {"by": "lines", "forward": true, "extend": true }, | |
"linewise": true }, | |
"context": [{"key": "setting.command_mode"}] | |
}, | |
{ "keys": ["i"], "command": "set_motion", "args": { | |
"motion": "move", | |
"motion_args": {"by": "lines", "forward": false, "extend": true }, |
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
<?= GridPageSize::widget(['pjaxId'=>'myAwesomeGridViewContainer']) ?> | |
<?php | |
Pjax::begin([ | |
'id'=>'myAwesomeGridViewContainer', | |
]) | |
?> | |
<?= | |
GridView::widget([ |
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
/*HTTPS for prod*/ | |
if (!defined('YII_DEBUG')) { | |
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){ | |
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
header("HTTP/1.1 301 Moved Permanently"); | |
header("Location: $redirect"); | |
} | |
} |
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
example inside FOO_VAR.env | |
located somewhere in your secret folder | |
PROD_DB_USERNAME = "foobar" | |
PROD_DB_PASSWORD = "veryveryharduncrackablepassword" | |
PROD_DB_HOST = "localhost" | |
PROD_DSN = "mysql:host=localhost;dbname=something_db" | |
then in your web/index.php |
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
input[type="date"]::before{ | |
color: #999; | |
content: attr(placeholder); | |
margin-right: 122px; // push the default placeholder out.. you can add more if you want | |
} | |
input[type="date"]:focus::before { | |
content: "" !important; | |
display: none; | |
} |
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
add_role( "subscriber", "Subscriber", array( | |
'read' => 1, | |
'level_0' => 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
console.log("%c WARNING!!!", "color:#FF8F1C; font-size:40px;"); | |
console.log("%c This browser feature is for developers only. Please do not copy-paste any code or run any scripts here. ", "color:#003087; font-size:12px;"); | |
console.log("%c For more information, http://en.wikipedia.org/wiki/Self-XSS", "color:#003087; font-size:12px;"); |
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
#!/bin/sh | |
PRODUCT_ID=$1 | |
if [ -z "${PRODUCT_ID}" ]; then | |
echo "Requires a product ID" | |
echo | |
echo "run \"./script.sh <id>\"" | |
fi |
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 | |
$reflFunc = new ReflectionFunction('THE_FUNCTION_NAME_HERE'); | |
echo $reflFunc->getFileName() . ':' . $reflFunc->getStartLine(); | |
?> |
OlderNewer