brew install https://gist.github.com/hisamu/5068438/raw/31f72891a5230350010161cf122653782789c7bb/nginx.rb
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 | |
class PasswordService | |
{ | |
public function __construct($algorithm = 'sha512', $encodeHashAsBase64 = true, $iterations = 5000) | |
{ | |
$this->algorithm = $algorithm; | |
$this->encodeHashAsBase64 = $encodeHashAsBase64; | |
$this->iterations = $iterations; | |
} |
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 | |
function generateGuid() | |
{ | |
$hash = strtoupper(hash('ripemd128', uniqid('', true) . md5(time() . rand(0, time())))); | |
$guid = '{'.substr($hash, 0, 8).'-'.substr($hash, 8, 4).'-'.substr($hash, 12, 4).'-'.substr($hash, 16, 4).'-'.substr($hash, 20, 12).'}'; | |
return $guid; | |
} |
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 | |
// the $item var is a Mage_Wishlist_Model_Item instance, used in the wishlist pview.html | |
function getOptionsWithValues() | |
{ | |
$attributes = $item->getOptionByCode('attributes')->getValue(); | |
if (!$attributes) | |
{ | |
return null; |
NewerOlder