Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Building AirGapped Crypto Vault

Ashish Kumar ashfame

💭
Building AirGapped Crypto Vault
View GitHub Profile
@JeffreyWay
JeffreyWay / gist:1374162
Created Nov 17, 2011
Prompt IE6 for Chrome Frame Install
View gist:1374162
<!--[if lt IE 7 ]>
<script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>CFInstall.check();</script>
<![endif]-->
@ashfame
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: http://www.viper007bond.com/
View gist:770180
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/tmp/php-cgi.socket;
server 127.0.0.1:9000;
}
server {
server_name example.com;
root /var/www;
@Viper007Bond
Viper007Bond / generate-thumbnails.php
Created May 25, 2012
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: http://www.viper007bond.com/
View My Magento Code.php
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
@iridakos
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.
*/
View magento_sql_snippets.md

Magento SQL Snippets

Clear Temporary Data Tables

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
@Vinai
Vinai / fix-url-keys.php
Last active Dec 13, 2019
This fixes the duplicate url_key issue in a Magento 1.8 / 1.13 installation.
View fix-url-keys.php
<?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.
@janfabry
janfabry / virtual-intermediate-images.php
Created Nov 13, 2010
WordPress Virtual intermediate images plugin (first public attempt)
View virtual-intermediate-images.php
<?php
/*
Plugin Name: Virtual intermediate images
Plugin URI: http://www.monkeyman.be
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.
View gist:4fa3c4228a8bb53cc71d
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
You can’t perform that action at this time.