Skip to content

Instantly share code, notes, and snippets.

@reinink
reinink / webpack.mix.js
Created November 20, 2017 13:19
Using Purgecss with Tailwind and Laravel Mix
let cssImport = require('postcss-import')
let cssNext = require('postcss-cssnext')
let glob = require('glob-all')
let mix = require('laravel-mix')
let purgeCss = require('purgecss-webpack-plugin')
let tailwind = require('tailwindcss')
mix.js('resources/assets/js/app.js', 'public/js')
.postCss('resources/assets/css/app.css', 'public/css/app.css', [
cssImport(),
@litzinger
litzinger / create-magento-user.php
Created June 4, 2015 16:57
Create a Magento user via PHP script to get into admin area.
<?php
define( 'USERNAME', 'new.user' );
define( 'PASSWORD', 'password' );
define( 'FIRSTNAME', 'Excited' );
define( 'LASTNAME', 'Croc' );
define( 'EMAIL', '[email protected]' );
include_once( 'app/Mage.php' );
Mage::app( 'admin' );
try {
<?php namespace LarryWeya\FormbuilderToJSONSchema\FormbuilderToJSONSchema;
class FormbuilderParser {
/**
* @var array the formbuilder schema we are working with
*/
protected $schema;
/**
@jbenet
jbenet / simple-git-branching-model.md
Last active May 3, 2025 18:07
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@astorm
astorm / gist:5479072
Last active December 16, 2015 18:39
Why do some Magento extensions "grab" the initial system->configuration page away from the General tab?

So, in the class

app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php

There's the following loop in the initTabs method.

foreach ($sections as $section) {            
    Mage::dispatchEvent('adminhtml_block_system_config_init_tab_sections_before', array('section' => $section));
    $hasChildren = $configFields->hasChildren($section, $websiteCode, $storeCode);
@drewgillson
drewgillson / CustomerWishlist.sql
Created June 2, 2012 13:52
Magento customer wishlist report
SELECT b.email, c.value AS name, a.updated_at, d.added_at, d.product_id, e.name, SUM(g.qty_ordered) AS purchased
FROM `wishlist` AS a
INNER JOIN customer_entity AS b ON a.customer_id = b.entity_id
INNER JOIN customer_entity_varchar AS c ON a.customer_id = c.entity_id AND c.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'firstname' AND entity_type_id = b.entity_type_id)
INNER JOIN wishlist_item AS d ON a.wishlist_id = d.wishlist_id
INNER JOIN catalog_product_flat_1 AS e ON d.product_id = e.entity_id
LEFT JOIN sales_flat_order AS f ON f.customer_email = b.email
LEFT JOIN sales_flat_order_item AS g ON (f.entity_id = g.order_id AND g.sku LIKE CONCAT(e.sku,'%') AND g.product_type = 'simple')
GROUP BY b.email, c.value, a.updated_at, d.added_at, d.product_id, e.name
@colinmollenhour
colinmollenhour / cleanCache.php
Created May 17, 2012 00:50
Simplified cache cleaning script for production updates.
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* @author Colin Mollenhour
*/
umask(0);
ini_set('memory_limit','512M');
@hdragomir
hdragomir / .gitconfig
Created February 22, 2012 11:11
By Popular demand, my gitconfig file
[user]
name = Horia Dragomir
email = [email protected]
[github]
user = hdragomir
[alias]
st = status -sb
ci = commit
co = checkout
p = push