Skip to content

Instantly share code, notes, and snippets.

View gist:2cf10e725bc3bc291cf4f19d4f039399
#reportlistcard .x-grid3-row {
height: 2em;
overflow: hidden;
.x-menu-floating .x-menu-list {
overflow: scroll;
/* uniform height rows */
View gist:b2159213116a236fd1267aa69dabc39f
// Bulk accept LinkedIn invites - good as of 30 Dec 2016
// Visit
var acceptButtons = document.getElementsByClassName("bt-invite-accept");
for (var i = acceptButtons.length - 1, acceptButton; acceptButton = acceptButtons[i]; i--) {;
View gist:565d7af482fd6c2fc6e6
Verifying that +benmarks is my blockchain ID.
View rewrite-classes.php
error_reporting(E_ALL | E_STRICT);
require 'app/Mage.php';
View factory-methods.php
error_reporting(E_ALL | E_STRICT);
require 'app/Mage.php';
benmarks / data-setup-config-migrate.php
Last active Aug 29, 2015
Basic data setup script for migrating config settings using store code.
View data-setup-config-migrate.php
/* @var $installer Mage_Core_Model_Resource_Setup */
/* @var $storeObj Mage_Core_Model_Store */
$installer = Mage::getResourceModel('core/setup','core_setup');
foreach (Mage::app()->getStores(false,true) as $storeCode => $storeObj) {
case 'somecode':
$path = 'design/theme/default'; //or one of design/theme/{layout|locale|skin|template}
benmarks / gist:8015156
Created Dec 18, 2013
Simple file operations via David Walsh
View gist:8015156
* ref
header('Content-Type: text/plain');
//##Create a File
//$my_file = 'file.txt';
//$handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file); //implicitly creates file
benmarks / ajax.php
Created Dec 5, 2013
Simple AJAX block responder example
View ajax.php
include 'app/Mage.php';
echo Mage::app()->getLayout()->createBlock('core/text')->setText('Foo')->toHtml();
benmarks / local.xml
Created Sep 26, 2013
Magento Layout XML - Block displacement via alias
View local.xml
<?xml version="1.0"?>
<block name="ben" type="core/text">
<action method="setText">
<text>SOME TEXT</text>
<reference name="header">
<action method="insert">
View config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Mage::getModel('catalog/product') -->