Skip to content

Instantly share code, notes, and snippets.

#reportlistcard .x-grid3-row {
height: 2em;
overflow: hidden;
}
.x-menu-floating .x-menu-list {
overflow: scroll;
}
/* uniform height rows */
@benmarks
benmarks / gist:b2159213116a236fd1267aa69dabc39f
Last active December 30, 2016 14:57
Bulk accept LinkedIn invites
// Bulk accept LinkedIn invites - good as of 30 Dec 2016
// Visit https://www.linkedin.com/people/pymk/hub?ref=global-nav&trk=nav_utilities_invites_header
var acceptButtons = document.getElementsByClassName("bt-invite-accept");
for (var i = acceptButtons.length - 1, acceptButton; acceptButton = acceptButtons[i]; i--) {
acceptButton.click();
}
@benmarks
benmarks / workbench.php
Last active April 5, 2016 15:07
Magento workbench script with full error output.
<?php
/**
* Working with Magento outside of the normal routing dispatch
* flow of Mage::run()? Mage::app(); is the way to go. This
* workbench script can be a quick way to check on various
* parts of the app, including configuration, which can be
* handy when verifying custom modules.
*/
//set some PHP params for ease of debugging
ini_set('display_errors',true);
Verifying that +benmarks is my blockchain ID. https://onename.com/benmarks
@benmarks
benmarks / gist:8015156
Created December 18, 2013 00:09
Simple file operations via David Walsh
<?php
/**
* ref http://davidwalsh.name/basic-php-file-handling-create-open-read-write-append-close-delete
*/
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
benmarks / ajax.php
Created December 5, 2013 22:57
Simple AJAX block responder example
<?php
//ini_set('display_errors',true);
include 'app/Mage.php';
//Mage::setIsDeveloperMode(true);
Mage::app()
->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL,Mage_Core_Model_App_Area::PART_EVENTS)
->loadAreaPart(Mage_Core_Model_App_Area::AREA_FRONTEND,Mage_Core_Model_App_Area::PART_EVENTS);
echo Mage::app()->getLayout()->createBlock('core/text')->setText('Foo')->toHtml();
@benmarks
benmarks / local.xml
Created September 26, 2013 13:46
Magento Layout XML - Block displacement via alias
<?xml version="1.0"?>
<layout>
<default>
<block name="ben" type="core/text">
<action method="setText">
<text>SOME TEXT</text>
</action>
</block>
<reference name="header">
<action method="insert">
@benmarks
benmarks / config.xml
Created February 5, 2013 16:32
Rewrites config
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Training_Practice>
<version>0.1.0.0</version>
</Training_Practice>
</modules>
<global>
<models>
<!-- Mage::getModel('catalog/product') -->
@benmarks
benmarks / demo.php
Created February 5, 2013 16:31
Rewrites demo
<?php
/**
* Working with Magento outside of the normal routing dispatch
* flow of Mage::run()? Mage::app(); is the way to go. This
* workbench script can be a quick way to check on various
* parts of the app, including configuration, which can be
* handy when verifying custom modules.
*/
//set some PHP params for ease of debugging
ini_set('display_errors',true);
<?php
ini_set('display_errors',true);
error_reporting(E_ALL | E_STRICT);
require 'app/Mage.php';
Mage::setIsDeveloperMode(true);
umask(0);