Skip to content

Instantly share code, notes, and snippets.

View bucha's full-sized avatar
😾

Alexander Buch bucha

😾
View GitHub Profile
@agnoster
agnoster / README.md
Last active May 10, 2025 17:44
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@bwaidelich
bwaidelich / CacheViewHelper.php
Created November 29, 2012 12:03
Cache View Helper for TYPO3 Fluid
<?php
namespace Your\Package\ViewHelpers;
/* *
* This script belongs to the TYPO3 Flow package "Your.Package". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
@n1k0
n1k0 / 404checker.js
Created January 11, 2013 10:55
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@SchumacherFM
SchumacherFM / FormatPrice.php
Created January 24, 2013 12:31
Magento: reformat the price system wide for any locale to a consistent format width the event currency_display_options_forming
<?php
class Namespace_Module_Model_Observer_FormatPrice
{
public function formatPrice(Varien_Event_Observer $observer)
{
$event = $observer->getEvent();
$options = $event->getCurrencyOptions();
/**
@xeoncross
xeoncross / watch.sh
Last active February 15, 2016 12:41
Watch a directory (recursively) and report any changes to the given PHP script
#!/bin/sh
if [ ! "$1" -o ! "$2" ]
then
echo "Usage: $ ./watch.sh [directory] [php script]"
exit
fi
echo "Started watching \"$1\" for \"$2\""
DIR="$( cd "$( dirname "$0" )" && pwd )"
@mrdoob
mrdoob / gist:5245098
Created March 26, 2013 12:45
Avoiding huge delta times when switching tabs.
// firefox
document.addEventListener( 'visibilitychange', function ( event ) {
if ( document.hidden === false ) {
lastTime = performance.now();
}
@edannenberg
edannenberg / replicate-attribute-values.php
Last active December 17, 2015 08:08
Fixes possible borked filtered navigation after upgrading older Magento versions.
<?php
/**
* This will replicate attribute values of configurable products to all it's child products.
*
* Rationale: After upgrading Magento 1.4 to 1.7 we found that our filtered navigation was
* missing quite alot of products. Turns out somewhere after 1.4 Varien changed the filtered
* navigation to only use the attributes of child products, ignoring the attributes of
* their configurable products.
*
@lastguest
lastguest / access_property.php
Last active January 24, 2024 09:18
PHP - Read/Write public/protected/private object property
<?php
// Access a property with no restrictions
function stole($object,$property){
$dict = (array)$object;
$class = get_class($object);
return isset($dict[$property])?
$dict[$property]:(isset($dict["\0*\0$property"])?
$dict["\0*\0$property"]:(isset($dict["\0$class\0$property"])?
$dict["\0$class\0$property"]:null));
@stuartsierra
stuartsierra / fresh-chrome.sh
Last active May 10, 2025 11:01
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;