Skip to content

Instantly share code, notes, and snippets.

What parts of our society are best governed by code?

Ashish Kumar ashfame

What parts of our society are best governed by code?
View GitHub Profile
JeffreyWay / gist:1374162
Created Nov 17, 2011
Prompt IE6 for Chrome Frame Install
View gist:1374162
<!--[if lt IE 7 ]>
<script src=""></script>
ashfame / generate-thumbnails.php
Created Aug 5, 2012 — forked from Viper007Bond/generate-thumbnails.php
WordPress: When a thumbnail image is requested of a specific width/height (rather than by name), generate it if it doesn't exist.
View generate-thumbnails.php
<?php /*
Plugin Name: Generate Thumbnails On The Fly
Description: When a thumbnail image is requested of a specific width/height (rather than by name), generate it if it doesn't exist.
Version: 1.0.0
Author: Alex Mills (Viper007Bond)
Author URI:
View gist:770180
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/tmp/php-cgi.socket;
server {
root /var/www;
View My Magento Code.php
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
iridakos / google-analytics-realtime-counter-update.js
Last active Feb 12, 2018
Show Google Analytics active users counter in document title and a notification whenever it changes.
View google-analytics-realtime-counter-update.js
This script will display the Google Analytics active users count on
the tab's title and in a notification whenever it changes.
Usage: Open your browser's console when in a Google Analytics Realtime
tab and paste the following.
Reload the tab to discard this functionality.
boogah / WP_Bag_of_Tricks.txt
Created Apr 30, 2010
Things I've learned by being a WordPress nerd.
View WP_Bag_of_Tricks.txt
WP Bag of Tricks
1. Helpful Scripts/Plugins:
Hacks: (Can be extremely resource intensive.)
necolas / snippet.js
Created Jun 14, 2011
Optimised async loading of cross-domain scripts
View snippet.js
* Updated to use the function-based method described in
* Better handling of scripts without supplied ids.
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],

Magento SQL Snippets

Clear Temporary Data Tables

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
janfabry / virtual-intermediate-images.php
Created Nov 13, 2010
WordPress Virtual intermediate images plugin (first public attempt)
View virtual-intermediate-images.php
Plugin Name: Virtual intermediate images
Plugin URI:
Description: Prevent creation of actual intermediate image sizes
Version: 0.1
Author: Jan Fabry
This plugin prevents the creation of actual intermediate image sizes. It does, however, fill in all metadata attributes as if the intermediate sizes exist. It is designed to work together with a plugin that can create these images on the fly, like monkeyman-on-demand-resizer.
Vinai / fix-url-keys.php
Last active Jul 6, 2021
This fixes the duplicate url_key issue in a Magento 1.8 / 1.13 installation.
View fix-url-keys.php
* Drop this into the shell directory in the Magento root and run with -h to see all options.
require_once 'abstract.php';
* Fix duplicate url keys for categories and products to work with the 1.8 alpha1 CE url key constraints.