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
/** | |
* Validate password | |
* | |
* @param Varien_Object $object | |
* @return bool | |
*/ | |
public function validate($object) | |
{ | |
$password = $object->getPassword(); |
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
server { | |
listen 80; | |
listen 443 ssl; | |
ssl_certificate /etc/pki/tls/certs/www.m.com_2015-06-18.crt; | |
ssl_certificate_key /etc/pki/tls/private/www.m.com_2015-06-18.key; | |
ssl_session_timeout 7m; | |
## Specify your SSL options here | |
ssl_protocols SSLv2 SSLv3 TLSv1; | |
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; |
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 | |
/** | |
* Usage: | |
* <?php | |
* // target class which should be wrapped | |
* class Class_For_Testing extends stdClass | |
* { | |
* public static function complexParams(stdClass $a, array &$foo = null, $bar = 'baz') | |
* { | |
* echo 'This is a test1' . PHP_EOL; |
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 | |
/** | |
* Sort versions list | |
* | |
* Add an alias in GIT | |
* $ git config --global alias.tags "!git tag | xargs -i -0 php "$(where version_sort)" {}" | |
* @link https://gist.github.com/andkirby/0046df5cad44f86b670a102b7c8b7ba7 | |
*/ | |
try { | |
if (php_sapi_name() != 'cli') { |
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 bash | |
alias __ch_task='if [[ "" != $(git rev-parse --git-dir 2> /dev/null) ]]; then echo -n $(ch config task); fi;' | |
export PS1='$(__ch_task)' |
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 bash | |
# This script can send Magento 1.x exception messages to Slack | |
# | |
# This file can be added to the root of a project | |
# Please be sure that you have a file var/log/exception.log in your project | |
# | |
# Run this file in background via command with "&" in the end | |
# $ slack-log-monitor.sh [OPTIONS] & | |
# See more options by command: $ slack-log-monitor.sh --help |
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
$a = new ArrayIterator; | |
$a->append(++$cnt); | |
$a->append(++$cnt); | |
foreach ($a as $i => $item) { | |
$cnt < 5 && $a->append(++$cnt); | |
var_dump($item); | |
} | |
//int(1) | |
//int(2) |
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 PHPSTORM_META { // we want to avoid the pollution | |
/** @noinspection PhpUnusedLocalVariableInspection */ | |
/** @noinspection PhpIllegalArrayKeyTypeInspection */ | |
$STATIC_METHOD_TYPES = [ | |
\Symfony\Component\Console\Command\Command::getHelper('') => [ | |
'question' instanceof \Symfony\Component\Console\Helper\QuestionHelper, | |
'process' instanceof \Symfony\Component\Console\Helper\ProcessHelper, | |
'debug_formatter' instanceof \Symfony\Component\Console\Helper\DebugFormatterHelper, | |
'descriptor' instanceof \Symfony\Component\Console\Helper\DescriptorHelper, |
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 bash | |
############################################################################### | |
# !!!!!!!!!! This script is deprecated, but you may continue use it. !!!!!!!! # | |
# Actually, it doesn't contain a code. It migrated into a repository. # | |
# Please take a look at https://github.com/rikby/xdebug-switcher # | |
############################################################################### | |
# | |
# Download this gist into file "~/.xd_swi" | |
# curl -Ls https://goo.gl/IxjlaC | bash | |
# or |
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
<?xml version="1.0"?> | |
<config> | |
<global> | |
<session_save><![CDATA[memcached]]></session_save> | |
<session_save_path><![CDATA[127.0.0.1:11211?persistent=0&weight=2&timeout=10&retry_interval=10]]></session_save_path> | |
<cache> | |
<backend>Mage_Cache_Backend_Redis</backend> |
OlderNewer