|# Use last tag as the base for the version. E.g. tag initial commit as 0.0|
|LAST_TAG_VERSION=`git describe --tags | cut -f1 -d"-"`|
|# Optional. Same as above but keeps the commit hash|
|#LAST_TAG_VERSION=`git describe --tags`|
|# Total number of commits in the repository|
|TOTAL_COMMITS=`git rev-list HEAD --count`|
|# Write the version numbers to the compiled product|
My Objective-C Style guide
This style guide outlines the coding conventions that I try to stick to when writing Objective-C. I'm posting it here mostly as a brain dump and easy reference for the future, and to formalise it a little more.
It's pretty similar to that of the NYTimes. This document is mostly a customised version of that, you should go check theirs out!
If you're looking to see some of the reasons behind some choices, or for something I haven't covered, look at the sites below, Apples documentation is pretty great.
Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2
Wes Winham email@example.com
There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.
|# HTTP Status Cats|
|# Apache (htaccess) config created by @dave1010|
|# Licensed CC BY 2.0|
|# Images CC BY 2.0, from GirlieMac's photostream:|
|# Usage: copy save this file as .htaccess or add it to your httpd.conf|
|ErrorDocument 404 '<a href="http://www.flickr.com/photos/girliemac/6508022985/" title="404 - Not Found by GirlieMac, on Flickr"><img src="http://farm8.staticflickr.com/7172/6508022985_b22200ced0.jpg" width="500" height="400" alt="404 - Not Found"></a>'|
|debug=`git diff --cached | grep -C 2 -E '+\s*And (open|show me the page|save_and_open_page)'`|
|pry=`git diff --cached | grep -C 2 -E 'binding.pry'`|
|debugger=`git diff --cached | grep -C 2 debugger`|
|console_log=`git diff --cached | grep -C 2 console.log`|
|conflicts=`git diff --cached | grep -C 2 -E '<<<|>>>'`|
|if [ -n "$debug" ]; then|
|echo "debugging statements added in this commit"|
The WordPress Way
A tongue-in-cheek look at coding standards in the WordPress core and the average WordPress plugin.
- # Declare variables
global- in case they're going to be used again
- All function/method parameters should be strings (e.g.
'no') - for clarity
- Functions and methods should return mixed types
- No need to separate PHP logic from HTML, JS or CSS
- Don't worry about PHP Notices - they're not important