Skip to content

Instantly share code, notes, and snippets.

View marcjenkins's full-sized avatar

Marc Jenkins marcjenkins

View GitHub Profile
<?php
function shortcodeButton( $atts, $content = null ) {
return '<a href="' . get_bloginfo('url') . '/contact/" class="btn">' . $content .' </a>';
}
add_shortcode('button', 'shortcodeButton');
<?php
function shortcodeButton( $atts, $content = null ) {
extract( shortcode_atts( array(
'link' => 'contact/',
'colour' => 'green'
), $atts ) );
return '<a href="' . "{$link}" . '" class="btn btn-' . "{$colour}" . '">' . $content . ' </a>';
}
<div class="grid container">
<div class="unit half">.unit.half</div>
<div class="unit half">.unit.half</div>
<div class="unit one-third">.unit.one-third</div>
<div class="unit one-third">.unit.one-third</div>
<div class="unit one-third">.unit.one-third</div>
<div class="unit one-quarter">.unit.one-quarter</div>
<div class="unit one-quarter">.unit.one-quarter</div>
<div class="unit one-quarter">.unit.one-quarter</div>
<div class="unit one-quarter">.unit.one-quarter</div>
@marcjenkins
marcjenkins / PM - Contract.md
Last active August 29, 2015 14:04
Project management - Contract Snippet

Project Management

If you do not have a preferred project management tool, we will provide you with a login for ours where you will be able to see the status of the project down to the specific task, so you will always be kept up to date. We’ll be relying on you to participate by answering our questions, stating your approval, requesting changes, and verifying completeness through the tool as well. We ask for a one business day turnaround time on responses so we can keep things moving along at a pace that will allow us to hit the milestones we decided on together. To keep the project organised and the management of it easier, we prefer not to communicate any of the information stated above over ordinary email.

@marcjenkins
marcjenkins / CSScomb.sublime-settings
Created December 12, 2014 17:18
CSS Comb settings file for Sublime Text
{
"config": {
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": "\t",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
@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);
?>
@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 / 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
Testing Slogger
@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'