Skip to content

Instantly share code, notes, and snippets.

@EHLOVader
EHLOVader / gist:1185442
Created September 1, 2011 04:17
Fix for broken Grid scrollers in Extjs 4.0.2a
Ext.require('Ext.grid.Panel',function(){
Ext.override(Ext.grid.Panel, {
constructor: function() {
this.on('scrollershow', function(scroller) {
if (scroller && scroller.scrollEl) {
scroller.clearManagedListeners();
scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
}
});
this.callOverridden();
<?php
// File containing cronjobs
$cronFile = dirname(__FILE__) . '/crontab';
// Lockfile to prevent multiple instances
$pidFile = dirname(__FILE__) . '/cron.lock';
// Exit file to signal a running instance to exit
$exitFile = dirname(__FILE__) . '/cron.exit';
@EHLOVader
EHLOVader / branches SVN
Created December 13, 2011 00:03
http conf for dynamic local dev
<VirtualHost *:80>
ServerAlias *.svn.branch.*
UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
RewriteLog "C:\WebDev\Apache\logs\mod_rewrite_svn.log"
RewriteLogLevel 1
VirtualDocumentRoot "C:\WebDev\SVN\%1\branches\%5+"
@EHLOVader
EHLOVader / gist:1473452
Created December 13, 2011 19:18
Fix for VirtualDocumentRoot issues in Apache.
<?php apache_setenv("DOCUMENT_ROOT",$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME'])) ?>
@EHLOVader
EHLOVader / gist:1486452
Created December 16, 2011 15:25
Lemonstand: get select options for field function example
public function get_field_name_options($current_key_value = -1)
{
$options = array(
'value'=>'text',
'someid'=>'Some Option'
);
if ($current_key_value == -1)
return $options;
/**
* Adds a log record to the order payment attempts log
* @param mixed $order Order object the payment attempt is belongs to
* @param string $message Log message
* @param bool $is_successful Indicates that the attempt was successful
* @param array $request_array An array containing data posted to the payment gateway
* @param array $response_array An array containing data received from the payment gateway
* @param string $response_text Raw gateway response text
* @param string $ccv_response_code Card code verification response code
* @param string $ccv_response_text Card code verification response text
<?
$partial = Cms_Partial::create()->find_by_name('payment:payflowpro');
if(!$partial) {
$partial = new Cms_Partial();
$partial->name = 'payment:payflowpro';
$partial->html_code = <<< EOH
<p>Please provide your credit card information.</p>
@EHLOVader
EHLOVader / Base File.sublime-settings.js
Last active September 29, 2015 18:18
My user settings for SublimeText2 (and ST3) which includes all fonts from http://www.codinghorror.com/blog/2007/10/revisiting-programming-fonts.html and links to download them when needed. Also added an extended monokai scheme and great theme for enhancing SublimeText
{
/**
* Monokai Extended Color Scheme
* Author: Jon Schlinkert
* Link: https://github.com/jonschlinkert/sublime-monokai-extended
*/
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",
/**
@EHLOVader
EHLOVader / sidebar_cart.php
Created January 23, 2012 20:10 — forked from dardub/gist:1665293
lemonstand side cart
<? $items = Shop_Cart::list_active_items();
$total = Shop_Cart::total_price();
$total_qty = Shop_cart::get_item_total_num();
?>
<div class="box base-mini mini-cart">
<div class="head">
<h4> &nbsp; My Cart</h4>
</div>
<div class="actions">
@EHLOVader
EHLOVader / shop_product.php
Created February 13, 2012 23:15
override to name manufacturer in shop products
if ($name == 'manufacturer')
{
if ($this->grouped)
return $this->master_grouped_product->manufacturer_link;
else
return $this->manufacturer_link;
return $this->grouped_attribute_name;
}