Skip to content

Instantly share code, notes, and snippets.

View leek's full-sized avatar

Chris Jones leek

View GitHub Profile
@leek
leek / _Magento1_DeleteTestData.md
Last active December 29, 2023 09:51
Magento 1 - Delete All Test Data

These set of scripts are for Magento 1. For Magento 2, see this Gist.

@leek
leek / gist:1233135
Created September 21, 2011 20:04
git flow Introduction

About Git Flow

Git Flow is an extension to Git that provides extra functionality and simple commands that force you into a structured and proper branching model. Git Flow is not required and in fact all commands ran by Git Flow can be done using standard Git commands. Git Flow just makes everything easier. Git Flow only needs to be installed on the developer's machine (or wherever development happens) and not on any production server.

Installing on Windows

Git Flow can be installed alongside TortoiseGit without issue, but there are some steps needed.

  1. Download/Install msysGit
  2. Download this file: bin.zip
@leek
leek / PhpunitController.php
Created January 6, 2012 15:47
PhpunitController for Symfony2
class PhpunitController extends Controller
{
public function runTestsAction($filterClass = null)
{
// Make sure PHPUnit is autoloaded
require_once('PHPUnit/Autoload.php');
set_time_limit(0);
$version = \PHPUnit_Runner_Version::id();
@leek
leek / rounded_corners_table.sass
Created January 20, 2012 02:39 — forked from Samnan/rounded_corners_table.sass
Here's how to do a table with rounded corners in CSS3 -- Updated: Fixed bug where bottom left corner wouldn't be rounded with only one TD in last TR
@import compass/reset
@import compass/css3/border-radius
table
border: none
border-collapse: separate
th, td
padding: 5px
thead
background-color: #f2f6fa
@leek
leek / pagination.html.twig
Created January 20, 2012 03:00
KnpPaginatorBundle - pagination template
<div class="pager">
{% if first is defined %}
<span class="first">
{% if current != first and first < 0 %}
<a href="{{ path(route, query|merge({'page': first})) }}">first</a>
{% else %}
first
{% endif %}
</span>
{% endif %}
@leek
leek / gist:1942116
Created February 29, 2012 16:19
INSERT ... ON DUPLICATE KEY UPDATE with Zend Framework (Zend_Db_Table))
<?php

/**
 * @method DbTable_Row_Foo createRow()
 */
class DbTable_Foo extends Zend_Db_Table_Abstract
{
    protected $_primary  = 'foo_id';
    protected $_name     = 'foo';
@leek
leek / migrate.sh
Created March 15, 2012 07:10
Rackspace Cloud Sites Migration Utility Script
#!/bin/bash
#
# @author: Chris Jones <leeked@gmail.com>
# @version: 1.1.0
#
# Rackspace Cloud Sites only allows running scripts via their web-based "cron" tool.
# FTP this script into your Web directory and add it to the scheduled tasks section.
# Set the "Command Language" to: perl
# Set the "Command to Run" to: migrate.sh refreshdb
@leek
leek / ExampleController.php
Created March 23, 2012 07:44
Symfony2 Event Listener that allows you to set Response parameters and still use the @template annotation from the SensioFrameworkExtraBundle
<?php
namespace Example\AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\HttpFoundation\Request,
Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class ExampleController extends Controller
{
@leek
leek / post-receive-pivotal.rb
Created May 4, 2012 18:14 — forked from pewniak747/post-receive-pivotal
Ruby Git post-receive hook to update Pivotal Tracker
#!/usr/bin/env ruby
# encoding: UTF-8
# file: hooks/post-receive-pivotal
require 'net/http'
require 'nokogiri'
# Ruby 1.8.7
class String
def force_encoding(enc)
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0