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
# This is a Makefile that implements helpers for a docker stack | |
# | |
# This example shows how to run a bash in a docker-compose container as your local user, | |
# so files are created owned by that user instead of root. | |
# | |
# For this to work, the user inside the container must have the same ID as the user outside. | |
# The name does not matter much but to avoid confusion it is helpful to make them have the same user name. | |
# You get a users ID by running the `id -u` command, and the users name is `whoami`. | |
# | |
# How it works: |
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
/* | |
* Based on IntelliJ PHPStorm JSON exporter. | |
* | |
* Available context bindings: | |
* COLUMNS List<DataColumn> | |
* ROWS Iterable<DataRow> | |
* OUT { append() } | |
* FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); } | |
* TRANSPOSED Boolean | |
* plus ALL_COLUMNS, TABLE, DIALECT |
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 | |
// workaround for object to array cast in PHP <7.2.0 | |
// https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts | |
// https://3v4l.org/05SPE | |
private function objectToArray($object) | |
{ | |
if (PHP_VERSION_ID < 70200) { | |
// work around PHP bug https://3v4l.org/05SPE | |
// https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts | |
if (is_object($object)) { |
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
<!-- put this code directly after <body> tag, for non-Yii environment, skip the if() statement --> | |
<?php if (YII_DEBUG): ?> | |
<!-- bootstrap responsive level indicator, only shown in debug mode --> | |
<div style="position: fixed; top: 0; left: 0; background: white; border: solid 1px #ccc; width: 25px; height: 18px; text-align: center; font-size: 10px; font-weight: bold; opacity: 0.5; z-index: 10000;" title="bootstrap responsive level indicator"> | |
<span class="visible-xs-inline">xs</span> | |
<span class="visible-sm-inline">sm</span> | |
<span class="visible-md-inline">md</span> | |
<span class="visible-lg-inline">lg</span> | |
</div> | |
<?php endif; ?> |
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
// My code | |
<?php | |
$collection=\app\models\Notifications::getCollection()->name; | |
if ($this->beginCache('Notifghjgjhgication', ['dependency' => [ | |
'class' => 'yii\caching\DbQueryDependency', | |
'query' => \app\models\Notifications::find()->where(["receiver_type" => "vendor", "receiver_id" => \Yii::$app->user->identity->_id, 'read_status' => FALSE]), | |
'method' => 'count', | |
]])) {?> | |
<li class="dropdown" id="Notification-list-container"> | |
<?= Yii::$app->runAction('/notification/default/notificationlist') ?> |
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
a: | |
lorem.ipsum | |
x: | |
lorem.dolor | |
y: | |
lorem.sit | |
b: |
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
# prepare server | |
ssh [email protected] | |
git init --bare /srv/testrepo.git | |
exit | |
# in local repo | |
git remote add testrepo [email protected]:/srv/testrepo.git |
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
#***************************************************************** | |
# Neo4j configuration | |
# | |
# For more details and a complete list of settings, please see | |
# https://neo4j.com/docs/operations-manual/current/reference/configuration-settings/ | |
#***************************************************************** | |
# The name of the database to mount | |
#dbms.active_database=graph.db |
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 | |
$tableSql = <<<SQL | |
DROP TABLE IF EXISTS `typebug`; | |
CREATE TABLE `typebug` ( | |
`int_col` integer NOT NULL, | |
`int_col2` integer DEFAULT '1', | |
`smallint_col` smallint(1) DEFAULT '1', | |
`char_col` char(100) NOT NULL, | |
`char_col2` varchar(100) DEFAULT 'something', |
NewerOlder