Skip to content

Instantly share code, notes, and snippets.

View marcjenkins's full-sized avatar

Marc Jenkins marcjenkins

View GitHub Profile
@marcjenkins
marcjenkins / .bash_profile
Created January 14, 2014 14:18
My .bash_profile cobbled together from numerous sources.
# Easier navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
# Shortcuts
alias brewup='brew update && brew upgrade && brew cleanup && brew doctor'
alias ping='ping -c 1'
alias ls='ls -lA'
alias d='cd ~/Dropbox'
Testing Slogger
@marcjenkins
marcjenkins / create-blog-post.bash
Created September 17, 2013 19:23
Quick and dirty bash script for creating new Kirby blog posts with Alfred.
# cd to blog folder
cd ~/Sites/plausiblethought/content/blog/
# count files
COUNT=$(ls | wc -l)
# make folder (e.g. 10-test)
mkdir $COUNT-{query}
# cd to folder created above
@marcjenkins
marcjenkins / .htaccess
Created September 17, 2013 19:18
Quick and easy way to create a htaccess file for multiple WordPress domains.
<IfModule mod_rewrite.c>
RewriteRule . - [E=rwbase:/]
RewriteCond %{HTTP_HOST} localhost$
RewriteRule . - [E=rwbase:plausiblethought/]
RewriteCond %{HTTP_HOST} staging.plausiblethought.co.uk$
RewriteRule . - [E=rwbase:plausiblethought/]
RewriteEngine On
RewriteBase /%{ENV:rwbase}
RewriteRule ^index\.php$ - [L]
@marcjenkins
marcjenkins / Redirect Template
Created September 17, 2013 16:11
WordPress template that directs page to first child.
<?php
/* Template Name: Redirect */
?>
<?php
$args = array('child_of'=>get_the_ID(), 'sort_column'=>'menu_order', 'sort_order'=>'ASC');
$pages = get_pages($args);
$first_child = $pages[0]->ID;
$link = get_permalink($first_child);
?>