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() { | |
$('article').find('a:not(.anchor)[href^=#]').each(function (i, e) { | |
var id = $(e).attr('href').replace(/^#/, ''); | |
if ($('a[id="' + decodeURI(id) + '"]').length == 0) { | |
console.log(e); | |
} else { | |
console.log('validated'); | |
} | |
}); | |
}()); |
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 | |
trait SoftDeleteTrait | |
{ | |
public static function deletedProperties() | |
{ | |
return ['deleted_at' => time()]; | |
} | |
public static function deleteAll($condition = '', $params = []) |
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 OCSClient extends CComponent | |
{ | |
public $login; | |
public $token; | |
public $url = 'https://b2btestservice.ocs.ru/b2b.asmx?WSDL'; |
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 | |
# Algorithm found here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html | |
class HashBuilder | |
{ | |
private $buf; | |
function __construct() | |
{ | |
$this->buf = imagecreatetruecolor(8, 8); | |
} |
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 | |
namespace console\components; | |
class XMLReader extends \XMLReader | |
{ | |
/** | |
* @param string $nodeName | |
* @return $this |
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 | |
namespace tests\codeception\common\unit; | |
use Codeception\Specify; | |
use yii\di\Instance; | |
use yii\test\InitDbFixture; | |
/** | |
* usage: |
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 | |
/** | |
* Presents lockingForUpdate ability to prevent dogpile effect | |
*/ | |
class EMemCache extends CMemCache | |
{ | |
/** | |
* @param $key string | |
* @param $timeoutSeconds int |
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 | |
// we have some model attributes in array | |
$modelAttributes = array( | |
'first', | |
'second' | |
); | |
// also, we have new attributes in same array. This can occure if your html form contains elements with names: | |
// Model[Attribute][] = first | |
// Model[Attribute][] = second |
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 php | |
<?php namespace App; | |
/** | |
* @param string $command | |
* @return string[] | |
*/ | |
function exec($command) | |
{ | |
echo "> $command\n"; |
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
# Создание шаблона с sql созданием бд и пользователя | |
template "/var/tmp/getmail_create_tables.mysql" do | |
source "mysql/getmail.sql.erb" | |
mode "0600" | |
# только если пользователя бд нет | |
not_if "mysql -e \"\" -h localhost -P 3306 getmail" | |
# запускаем на выполнение | |
notifies :run, "execute[mysql_create_getmail_tables]", :immediately | |
end |
OlderNewer