Skip to content

Instantly share code, notes, and snippets.

View petemcw's full-sized avatar

Pete McWilliams petemcw

View GitHub Profile
@davidalexander
davidalexander / gist:1086455
Last active September 7, 2023 07:42
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@ChrisMcKee
ChrisMcKee / .gitignore
Created June 9, 2011 12:54
.gitignore file for magento projects
.htaccess
.htaccess.sample
LICENSE.html
LICENSE.txt
LICENSE_AFL.txt
RELEASE_NOTES.txt
app/*.*
app/*/*.*
app/*/*/*.*
!app/etc/modules/<Namespace>_*.xml
@kopischke
kopischke / markdown2evernote.rb
Created June 5, 2011 16:57
OS X service scripts
#!/usr/bin/env ruby -wKU
# Adapted from Brett Terpstra’s original “Markdown to Evernote” service (http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/)
# Martin Kopischke 2011 – License: Creative Commons Attribution Share-Alike (CC BY-SA) 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/)
# Changes: – create only one Evernote note per (Multi)Markdown input passed (instead of one per line)
# – do not choke on shell escape characters (use Tempfile instead of shell pipe for osascript)
# – default to MultiMarkdown 3 executable (instead of MMD 2 Perl script)
# – make smart typography processing optional (set SMARTY to 'false' to bypass processing;
# note smart typography cannot be disabled in MMD 3.0 and 3.0.1
# – handle both smart typography processing scripts (ie. SmartyPants.pl)
@oisin
oisin / gist:952572
Created May 2, 2011 23:36
API version checking using Sinatra's before filter
require 'sinatra'
# Set the version of the API being run here
#
MAJOR_VERSION = 1
MINOR_VERSION = 0
helpers do
def version_compatible?(nums)
return MAJOR_VERSION == nums[0].to_i && MINOR_VERSION >= nums[1].to_i
@petemcw
petemcw / key_generator.rb
Created April 27, 2011 15:16
Random Key Generator
class KeyGenerator
require "digest/sha1"
def self.generate(length = 12)
Digest::SHA1.hexdigest(Time.now.to_s + rand(567891234).to_s)[1..length]
end
end
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active December 23, 2019 02:32
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@petemcw
petemcw / my.cnf
Created February 25, 2011 20:11
Ubuntu MySQL 5.1 Configuration - 4GB RAM, Heavy InnoDB
# The MySQL database server configuration file.
#
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM
#
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
@mojombo
mojombo / vwilight.vim
Created January 26, 2011 03:23
vwilight.vim: A TRUE Twilight color theme for Vim
" Vim color file
" Converted from Textmate theme Twilight using Coloration v0.2.5 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@petemcw
petemcw / .gitignore
Created December 16, 2010 18:24
What to ignore from Magento in Git
# Magento Connect 2 cache directories and files
downloader/pearlib/cache/
downloader/*.cfg
# Magento runtime media files
media/catalog/product/cache/
media/tmp/
media/js/
media/css/
media/.thumbs/
@ticean
ticean / apache-site.conf.erb
Created December 10, 2010 04:06 — forked from yevgenko/apache-site.conf.erb
chef magento roles examples
<% if @params[:ssl] %>
<VirtualHost <%= node[:ipaddress] %>:443>
ServerName <% if node[:magento][:server][:secure_domain] %><%= node[:magento][:server][:secure_domain] %><% else %><%= @params[:server_name] %><% end %>
SSLEngine on
SSLCertificateKeyFile ssl/<%= @params[:server_name] %>.pem
SSLCertificateFile ssl/<%= @params[:server_name] %>.pem
SSLProtocol all
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
<% else %>