Skip to content

Instantly share code, notes, and snippets.

View amcgowanca's full-sized avatar

Aaron McGowan amcgowanca

View GitHub Profile

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@amcgowanca
amcgowanca / 1356276-D7-inheritable-profiles
Created August 9, 2013 06:51
Allows for a single base installation profile to exist in Drupal 7.
diff --git a/includes/common.inc b/includes/common.inc
index 262e1c5..5523ada 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -232,6 +232,29 @@ function drupal_get_profile() {
return $profile;
}
+/**
+ * Gets the name of the currently active installation profile's base profile.
@amcgowanca
amcgowanca / gist:5095828
Created March 6, 2013 00:54
Fanshawe College, INFO-5094: LAMP 2, Project 1 - IteratorMode examples of using Bitwise operators
<?php
class IteratorMode
{
const KEEP = 1;
const DELETE = 2;
const FIFO = 4;
const LIFO = 8;
public static function isKeep($mode)
@amcgowanca
amcgowanca / gist:5068900
Created March 1, 2013 23:57
A sloppy LinkedList<TVal>.Remove(ILinkedNode<int, TVal> node) method.
public bool Remove(ILinkedNode<int, TVal> node)
{
if (this.Count.Equals(0))
{
return false;
}
bool removed = false;
if (this.First.Equals(node))
{