Skip to content

Instantly share code, notes, and snippets.

View bluvertigo's full-sized avatar

Andrea Gentili bluvertigo

View GitHub Profile
@jasontipton
jasontipton / local.xml
Last active December 23, 2020 16:49
Reorder and Add Class to Top.Links - Magento 1.9 Community Edition
<?xml version="1.0"?>
<!--
[Your site name] XML overrides
-->
<layout version="0.1.0">
<!-- updating top.links to add class names -->
<!-- Section 1: Removing Current Links -->
<default>
<reference name="top.links">
<!-- Removes 'My Account' link -->
@yuval-a
yuval-a / js-micro.js
Last active November 28, 2024 08:13
Javascript micro-optimizations
NOTE: This document is OLD - and most of the tips here are probably outdated, since newer versions of Javascript have been
released over the years - with newer optimizations and more emphasis on optimizing newly supported syntax.
// Array literal (= []) is faster than Array constructor (new Array())
// http://jsperf.com/new-array-vs-literal/15
var array = [];
// Object literal (={}) is faster than Object constructor (new Object())
// http://jsperf.com/new-array-vs-literal/26
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 30, 2025 16:15
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@PhilKershaw
PhilKershaw / gist:f8e995e6b7d749e30740
Last active November 2, 2020 05:45
Simple script to export a CSV from Magento for consumption by eKomi
<?php
require_once ("app/Mage.php");
class TradeOrders
{
private static $headers = array('ORDER_ID', 'EMAIL', 'LAST_NAME', 'FIRST_NAME', 'PRODUCT_ID', 'PRODUCT_NAME');
public static function get($from, $to) {
// Fetch all UK Trade orders within specified date range
@vsoch
vsoch / index.php
Last active June 2, 2024 14:28
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";
@thagxt
thagxt / Magento How to get the customer login, logout, register and checkout urls.php
Created April 23, 2014 12:10
Magento How to get the customer login, logout, register and checkout urls
login url
<?php echo Mage::getUrl('customer/account/login'); ?>
logout url
<?php echo Mage::getUrl('customer/account/logout'); ?>
My Account url
<?php echo Mage::getUrl('customer/account'); ?>
Register url
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 25, 2025 20:12
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@daithi-coombes
daithi-coombes / get_months.php
Created March 26, 2014 09:41
Get an array of months between two dates
$StartDate = @strtotime("Jan 2003");
$StopDate = @strtotime("Apr 2004");
/**
* Gets list of months between two dates
* @param int $start Unix timestamp
* @param int $end Unix timestamp
* @return array
*/
function echoDate( $start, $end ){
@cprerovsky
cprerovsky / snap.php
Created February 21, 2014 15:53
Foscam PHP snapshot script
<?php
header('Content-Type: image/jpeg');
echo file_get_contents('http://[FOSCAM_IP]:[PORT]/snapshot.cgi?user=[USERNAME]&pwd=[PASSWORD]');
@andrewbolster
andrewbolster / eventcamsort
Created January 11, 2014 16:42
Event Cam Management script
#!/bin/bash
BASE="/mnt/eventcam/"
COMPRESS=0
RERUN=0
UPLOAD=1
TODAY=`date +%Y%m%d`
# Move all jpgs in to per date folder for processing
for file in `find $BASE -maxdepth 1 -name '*.jpg' -type f -print`; do
newfilename=`echo $file | awk -F '-' '{print $2$3}'`
date=`echo $newfilename | cut -c 1-8`