Skip to content

Instantly share code, notes, and snippets.

View colinmollenhour's full-sized avatar

Colin Mollenhour colinmollenhour

View GitHub Profile
@colinmollenhour
colinmollenhour / process-mysqldump.c
Last active July 10, 2018 00:11 — forked from divinity76/process-mysqldump.c
Add newlines before parenthesis for a SQL mysqldump
// gcc -O2 -Wall -pedantic process-mysqldump.c -o process-mysqldump
// Usage: cat dump.sql | process-mysqldump
// Or : process-mysqldump dump.sql
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#define BUFFER 100000
@colinmollenhour
colinmollenhour / simple_modman_test.sh
Last active April 26, 2017 15:35 — forked from syhe/simple_modman_test.sh
Simple modman test
#!/usr/bin/env bash
set -e
MODMAN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/modman"
TMPDIR=$(mktemp -d)
function cleanup () {
rm -rfv "$TMPDIR"
}
trap cleanup EXIT
@colinmollenhour
colinmollenhour / shell_delete_unused_images.php
Last active February 17, 2020 18:51 — forked from aleron75/shell_delete_unused_images
Delete no more used Product Images on Magento
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
public function run()
@colinmollenhour
colinmollenhour / boris-mage.php
Last active December 17, 2015 08:19 — forked from Vinai/boris-mage.php
Search for boris in PHP default include path and Magento's lib directory.
#!/usr/bin/env php
<?php
//
// PHP REPL with initialized Magento environment
//
// Thanks to https://github.com/d11wtq/boris
//
// Run this script anywhere in the Magento directory tree to start the REPL
//
@colinmollenhour
colinmollenhour / average.awk
Created March 27, 2012 00:35 — forked from anonymous/average.awk
Average multiple CSV files
#!/bin awk -f
BEGIN {
FS=","
rows[""]=0
rowsc[""]=0
labels[""]=0
}
{
if (NR == 1) { header=$0; cols=NF; }