Skip to content

Instantly share code, notes, and snippets.

# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
# cd .. with multiple jumps or jump up to name
..() {
if [ "-" == "$1" ]; then cd -; return; fi; # return to previous directory
if [ "/" == "$1" ]; then cd /; pwd; return; fi; # jump to root
if [ -z "$1" ]; then cd ../; pwd; return; fi; # jump up one
declare -i count=$1; # get a jump count
if [ $count -eq 0 ]; then # wasn't a number, look for name
local go=$(while [[ "/" != "$PWD" && "$(basename $PWD)" != "$1" ]]; do cd ..; done; pwd);
# jump up to named directory, or don't move if name wasn't found
if [ "/" != "$go" ]; then cd $go; else return; fi;
# go to a drupal module folder, from anywhere in the site hierarchy,
# with autocompletion
function dm {
drroot;
cd sites/all/modules;
#echo contrib/$1;
if [ -d "contrib/$1" ]
then
cd "contrib/$1";
elif [ -d "custom/$1" ]