brew install https://gist.github.com/hisamu/5068438/raw/31f72891a5230350010161cf122653782789c7bb/nginx.rb
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 | |
// 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; |
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 | |
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 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 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 Acme\CoreBundle\Twig; | |
class DateSinceExtension extends \Twig_Extension | |
{ | |
public function getFilters() | |
{ | |
return array( | |
'date_since' => new \Twig_Filter_Method($this, 'dateSince'), |
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
parameters: | |
states: | |
AC: | |
code: AC | |
state: 'Acre' | |
AL: | |
code: AL | |
state: 'Alagoas' | |
AM: | |
code: AM |
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 python | |
""" | |
To use this you have to include the task ID on the commit message. | |
Example: Fixing typo, #9283764018 | |
You can as well close a task within the commit message. | |
Example: Improving the docs, closes #9823761989 | |
""" |
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
<snippet> | |
<content><![CDATA[echo "<pre>"; print_r (${1:variable}); die("</pre>");]]></content> | |
<tabTrigger>dv</tabTrigger> | |
<scope>source.php</scope> | |
<description>PHP: debug with print_r</description> | |
</snippet> |
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 python | |
# Import any playlist (within the script) to Google Music All Access playlist. | |
# | |
# Based on Tim Hutt's script: | |
# https://gist.github.com/Timmmm/6572592 | |
# | |
# Instructions: | |
# 1. Write the playlist down to the file | |
# 2. Install `gmusicapi` using `pip`: `pip install gmusicapi` |
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
require File.expand_path("../../Abstract/abstract-php-extension", __FILE__) | |
class Php71Xdebug < AbstractPhp71Extension | |
init | |
desc "Provides debugging and profiling capabilities." | |
homepage "http://xdebug.org" | |
url "https://pecl.php.net/get/xdebug-2.4.1.tgz" | |
sha256 "23c8786e0f5aae67b1e5035972bfff282710fb84c483887cebceb8ef5bbdf8ef" | |
head "https://github.com/xdebug/xdebug.git" |
OlderNewer