Skip to content

Instantly share code, notes, and snippets.

View WinstonN's full-sized avatar

Winston Nolan WinstonN

  • Christchurch, New Zealand
View GitHub Profile
@WinstonN
WinstonN / ArrayFunctions.mq4
Last active January 8, 2018 19:14 — forked from currencysecrets/ArrayFunctions.mq4
Array utility functions for MetaTrader 4. Helpful functions for doing some of the repetitive tasks in MQL.
/*
* clearIntArray
* This function deletes all items in array (sets it to 0) and resizes array according to size (default = 1).
* @param int& theArray - passing the array by reference
* @param int size - size of the array (default = 1)
* @return int blank array of size
*/
void clearIntArray( int& theArray[], int size = 0 ) {
ArrayResize( theArray, size );
if ( size > 0 ) { ArrayInitialize( theArray, 0 ); }
@WinstonN
WinstonN / gist:2ac4d50af25d29d3942e517e9faab418
Created July 26, 2016 17:49 — forked from JeroenBoersma/gist:60a4acb8e56498bce41c
Magento cleanup unused product images
<?php
/**
* Cleanup images from Magento
*/
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
@WinstonN
WinstonN / gist:5b4abbec9f6d2ab58670
Last active August 29, 2015 14:28 — forked from ryaan-anthony/gist:9c3ffc3d75dc9c754f3d
Magento - remove broken images
<?php
include_once("app/Mage.php");
umask(0);
Mage::app('admin');
$collection = Mage::getResourceModel('catalog/product_collection');
//in module/controllers
//NOT in modules/controllers/Adminhtml
class MageB2B_Sublogin_SubloginController extends Mage_Adminhtml_Controller_Action
<admin>
<routers>
<sublogin>
<use>admin</use>
<args>
CREATE VIEW customer_view AS
SELECT e.entity_id,
e.group_id,
e.store_id,
e.website_id,
e.email,
confirmation.value AS confirmation,
created_in.value AS created_in,
default_billing.value AS default_billing,
@WinstonN
WinstonN / default.vcl
Last active August 29, 2015 14:10 — forked from fbrnc/default.vcl
backend default {
.host = "127.0.0.1";
.port = "80";
.first_byte_timeout = 300s;
}
/*
Like the default function, only that cookies don't prevent caching
*/
sub vcl_recv {