Skip to content

Instantly share code, notes, and snippets.

View andyt's full-sized avatar

Andy Triggs andyt

  • Pembrokeshire, Wales, UK
View GitHub Profile
@aleron75
aleron75 / shell_delete_unused_images
Last active October 24, 2023 19:59
Delete no more used Product Images on Magento 1
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
@tadast
tadast / ssl_puma.sh
Last active January 29, 2024 04:41 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@despo
despo / deferred_garbage_collection.rb
Created December 13, 2013 11:31
Deferred Garbage Collection
class DeferredGarbageCollection
DEFERRED_GC_THRESHOLD = (ENV['DEFER_GC'] || 15.0).to_f
@@last_gc_run = Time.now
def self.start
GC.disable if DEFERRED_GC_THRESHOLD > 0
end
@zuk
zuk / drowsy_backbone.js
Created June 5, 2012 19:06
DrowsyDromedary usage with Backbone.js
var drowsyUrl = 'http://localhost:9292';
var db = 'fridge';
/** Set up a basic Model class for Drowsy that we will extend from **/
var DrowsyModel = Backbone.Model.extend({
idAttribute: '_id',
// needed to deal with the way Drowsy returns ObjectIds
parse: function(data) {
data._id = data._id.$oid;