Skip to content

Instantly share code, notes, and snippets.

@madeindjs
madeindjs / defer.js
Created December 2, 2016 14:28
make script execution wait until jquery is loaded
function defer(method) {
if (window.jQuery)
method();
else
setTimeout(function() { defer(method) }, 50);
}
@bluec
bluec / export_categories.php
Created November 28, 2016 13:17
Export Magento category tree with full names, paths and URLs
<?php
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
Mage::app();
$category = Mage::getModel('catalog/category');
$tree = $category->getTreeModel();
$tree->load();
@subfuzion
subfuzion / curl.md
Last active May 13, 2025 18:51
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@nicksantamaria
nicksantamaria / mydumper-install-ubuntu14.04.sh
Created December 29, 2015 23:40
Install mydumper / myloader from source on Ubuntu 14.04
# Switch to root user.
sudo su -
# Update apt repositories and install dependencies.
apt-get update
apt-get install libglib2.0-dev libmysqlclient15-dev zlib1g-dev libpcre3-dev libssl-dev cmake
# Download mydumper source and move to appropriate directory.
cd /usr/local/share
wget https://launchpad.net/mydumper/0.9/0.9.1/+download/mydumper-0.9.1.tar.gz
@Chandler
Chandler / slack_history.py
Last active March 27, 2025 01:16
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
@tiagones
tiagones / transaction-email-variables
Created September 29, 2015 17:55
Magento - Transaction Email Variables
Para a inscrição:
1. {{var customer}} irá imprimir todas as informações do cliente
2. {{var customer.ID}}
3. {{var customer.email}}
4. {{var customer.firstname}}
5. {{var customer.lastname}}
6. {{var customer.name}}
7. {{var customer.password}}
8. {{var customer.created_in}}
@mogsdad
mogsdad / NSLookup.gs
Last active September 12, 2018 05:48
NSLookup - Google Sheets custom function to Perform a Network Service Lookup, using StatDNS API. From "Nslookup or dig in Google App Script" (http://stackoverflow.com/a/30610580/1677912).
/**
* Perform a Network Service Lookup, using StatDNS API.
*
* @param {"google.com"} dn A well-formed domain name to resolve.
* @return {String} Resolved IP address
* @customfunction
*/
function NSLookup(dn) {
// From gist.github.com/mogsdad/ece531531e0ef5dc355d
var url = "http://api.statdns.com/%FQDN%/a".replace("%FQDN%",dn);
@tmilos
tmilos / README.md
Last active May 6, 2025 09:51
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

@tegansnyder
tegansnyder / category-path-skus-query.md
Created November 20, 2014 14:45
List the Magento Skus and the Category Paths they belong in

Find a list of magento sku's and the category paths they belong in via MySQL query.

SELECT product_id, sku, catid, cce.path FROM (
    SELECT entity_id as product_id, category_id as catid FROM (
        SELECT `e`.entity_id, `at_category_id`.`category_id` 
        FROM `catalog_product_entity` AS `e` 
        LEFT JOIN `catalog_category_product` AS `at_category_id`
        ON (at_category_id.`product_id`=e.entity_id)
    ) sub_query
) final_query
@LeCoupa
LeCoupa / imacros-bootstrap.js
Last active August 12, 2022 10:47
iMacros Bootstrap. Write your Macros with JavaScript --> https://github.com/LeCoupa/awesome-cheatsheets
// iMacros Bootstrap - Write your macros with JavaScript.
// Be careful, you need to rename and set the extension of your macro to ".js".
// 1. Variables Initialization.
var variable1, variable2, variable3;
macro = "";