Skip to content

Instantly share code, notes, and snippets.

View JeffCost's full-sized avatar

Jeff C JeffCost

  • August Ash Inc.
View GitHub Profile
@JeffCost
JeffCost / MAGE: magcontroller.sublime-snippet
Last active October 10, 2015 22:38
(controller) Sublime Snippet for Magento
<snippet>
<content><![CDATA[<?php
class ${1:namespace}_${2:moduleName}_${3:ControllerName}Controller extends Mage_Core_Controller_Front_Action {
public function indexAction()
{
${4:// ... code ...}
}
}${0}]]></content>
@JeffCost
JeffCost / gist:3843711
Created October 6, 2012 03:51
Keeping your fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@JeffCost
JeffCost / Git update-index --assume-unchanged.md
Created October 6, 2012 05:47 — forked from grafikchaos/Git update-index --assume-unchanged
Ignore uncommitted changes in tracked files with Git

IGNORE LOCAL CHANGES

Ignore local changes to repository files or directories git update-index --assume-unchanged path/to/file/or/directory

ALIAS

Or you can alias it in your ~/.gitconfig [alias] au = update-index --assume-unchanged

UN-IGNORE LOCAL CHANGES

@JeffCost
JeffCost / GIT: Ignore tracked files
Created December 14, 2012 04:53
GIT: Ignore tracked files
[alias]
ignore = !git update-index --assume-unchanged
unignore = !git update-index --no-assume-unchanged
ignored = !git ls-files -v | grep ^[a-z]
Usage:
git ignore <file>
git unignore <file>
git ignored
@JeffCost
JeffCost / GIT: Add-Remove Tags
Last active December 17, 2015 18:29
GIT: Add/Remove Tags
1) Delete the v0.4 tag locally: git tag -d v0.4
2) Delete the v0.4 tag on GitHub (which removes its download link): git push origin :v0.4
3) Add a new tag for the newest stable release: git tag -a v0.5 -m "Version 0.5 Stable"
4) Push the latest tag to GitHub (two dashes): git push --tags

A collection of Drupal snippets.

Home / Front Page Tricks

Remove the Default message on home page with our creating a post

<?php if(drupal_is_front_page()) {unset($page['content']['system_main']['default_message']);} ?>

A guide for installing modules with the MAGE installer

Magento Mage installer

Adjust permissions

Make the mage package executable

LOCAL ONLY

chmod 777 ./mage

#
# Run as root
# $ bash <(curl -s https://raw.github.com/gist/1631411)
#
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl \
libssl-dev \
@JeffCost
JeffCost / PHP: Composer from local repo
Last active December 21, 2015 07:19
PHP: Composer from local repo
"repositories": [
{
"type":"vcs",
"url":"/home/jeff/dev/bundles/MyCustomBundle"
}
],
"require":{
"jeff/some-package":"dev-master"
}
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon