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
function enable_xdebug() { | |
sudo sed -i'' 's/^;*//g' /etc/php5/conf.d/xdebug.ini | |
} | |
function disable_xdebug() { | |
sudo sed -i'' 's/^/;/g' /etc/php5/conf.d/xdebug.ini | |
} |
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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
index = Nokogiri::HTML(open('http://rubyrogues.com/episode-guide/')); | |
index.css('a[rel=bookmark]').each do |link| | |
podcast = Nokogiri::HTML(open(link['href'])); | |
title = podcast.css('.entry-title').text |
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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
MAX_THREADS = 5 | |
thread_pool = [] | |
index = Nokogiri::HTML(open('http://rubyrogues.com/episode-guide/')); |
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
sudo pear config-set php_bin /opt/local/bin/php | |
sudo pear config-set php_dir /opt/local/lib/php/pear | |
sudo pear config-set ext_dir /opt/local/lib/php54/extensions/no-debug-non-zts-20100525 | |
sudo pear config-set bin_dir /opt/local/bin | |
sudo pear config-set cfg_dir /opt/local/lib/php/pear/cfg | |
sudo pear config-set doc_dir /opt/local/lib/php/pear/docs | |
sudo pear config-set www_dir /opt/local/lib/php/pear/www | |
sudo pear config-set test_dir /opt/local/lib/php/pear/tests | |
sudo pear config-set data_dir /opt/local/lib/php/pear/data |
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
<IfModule mod_fastcgi.c> | |
AddHandler php5-fcgi .php | |
Action php5-fcgi /php5-fcgi | |
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi | |
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization | |
</IfModule> |
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 | |
$options = array( | |
'product' => 8234, | |
'bundle_option'=>array( | |
'297'=>1233 | |
), | |
'qty'=>$qty | |
); |
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 | |
$selectionQtys = array_reduce($savedSelections, function($sum, $selectionId) { $sum[$selectionId]++; return $sum; }, array()); |
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 ZdbCountExample | |
{ | |
public function doSelect() | |
{ | |
$pageSize = 1000; | |
$numPages = ceil($this->count($this->baseSelect()) / $pageSize); | |
for ($page = 0; $page <= $numPages; $page++) { |
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 | |
/* @var $installer Mage_Model_Customer_Entity_Setup */ | |
$installer = $this; | |
/* @var $eavConfig Mage_Eav_Model_Config */ | |
$eavConfig = Mage::getSingleton('eav/config'); | |
$installer->startSetup(); |
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
location ^~ /store/app { | |
access_log off; | |
log_not_found off; | |
return 404; | |
} |