Skip to content

Instantly share code, notes, and snippets.

View wsakaren's full-sized avatar

Karen Baker wsakaren

  • WebShopApps
  • Austin, TX
View GitHub Profile
@wsakaren
wsakaren / get_all_github_repos
Created December 7, 2013 14:14
Get all private repos from an organization
curl -u "<user>" https://api.github.com/orgs/<orgname>/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
$ git remote add upstream git://github.com/pjhyett/github-services.git
$ git fetch upstream
# then: (like "git pull" which is fetch + merge)
$ git merge upstream/master master
@wsakaren
wsakaren / import_sql
Created December 20, 2013 13:33
Importing database via command line with MAMP
/Applications/MAMP/Library/bin/mysql -u <user> -p<pwd> <db> < ~/Downloads/db.sql
e.g.
/Applications/MAMP/Library/bin/mysql -p -u storepickup70 storepickup70 < ~/Webshopapps/csv/tmplog/webshopapps_locations.sql
@wsakaren
wsakaren / load_template_layout
Created December 21, 2013 04:15
Call a helper to conditionally load a template
<adminhtml_sales_order_create_index>
<reference name="shipping_method">
<action method="setTemplate">
<template helper="wsacommon/template/adminTemplate">
<arg>adminhtml_sales_order_create_index</arg>
</template>
</action>
</reference>
</adminhtml_sales_order_create_index>
@wsakaren
wsakaren / finder_root
Last active January 1, 2016 00:19
From http://www.mikesel.info/launch-finder-as-root/ Run finder as root on mavericks
killall Finder & sudo /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
Installing ant
sudo su
mkdir /usr/local/share
mkdir /usr/local/bin
cd ~/Webshopapps/repos13/Utilities/Ant
cp -r apache-ant-1.8.2 /usr/local/share
sudo ln -s /usr/local/share/apache-ant-1.8.2/bin/ant /usr/local/bin/ant
chmod 775 /usr/local/bin/ant
git remote -v
# List the current remotes
# origin https://github.com/user/repo.git (fetch)
# origin https://github.com/user/repo.git (push)
git remote add upstream https://github.com/otheruser/repo.git
# Set a new remote
git remote -v
# Verify new remote
ma set mark a at current cursor location
'a jump to line of mark a (first non-blank character in line)
`a jump to position (line and column) of mark a
d'a delete from current line to line of mark a
d`a delete from current cursor position to position of mark a
c'a change text from current line to line of mark a
y`a yank text to unnamed buffer from cursor to position of mark a
:marks list all the current marks
:marks aB list marks a, B
nicksays.co.uk/magento-events-cheat-sheet-1-7
There is not a list of all magento events, because most of the events are dynamically named.
If you ask me, knowing these key events (and the consequences) is a good starting point (beside the list from nick):
Every Object extended from Mage_Core_Model_Abstract dispatches a lot events around loading, saving and deleting:
app/code/core/Mage/Core/Model/Abstract.php:255