Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dave1010's full-sized avatar

Dave Hulbert dave1010

View GitHub Profile
@endocrimes
endocrimes / StyleGuide.md
Last active August 29, 2015 13:55
Objective-C style guide

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!

Useful Resources

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.

@Numan1617
Numan1617 / gist:dff95e1332dd14cc87c3
Created April 8, 2014 08:51
iOS - Automatic Version Numbering
# 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
#!/usr/bin/env ruby
#
# Update JIRA with git commit messages
#
# == Usage ==
#
# To update a JIRA issue, prepend the first line of your git commit message
# with the issue key and a colon:
#
# $ git commit -m "GIT-1: Updates something"
@dave1010
dave1010 / jQuery.twtShrt.js
Created October 1, 2010 18:07
jQuery.fn.twtShrt
/**
* Make a form field shorten text as you type
* Made for keeping tweets < 140 chrs
* Usage: $('textarea').twtShrt();
* @author dave1010
*/
jQuery.fn.twtShrt = function() {
var o = [
"seriously","have to", "what is", "done", "oh my god", "oh my gosh", "face to face", "for the win", "for the loss", "in real life", "your mileage may vary", "best regards", "joint venture", "let me know", "not safe for work", "are you ok", "tomorrow", "as soon as possible", "be right back", "be back later", "be back soon", "at the moment", "by the way", "in my honest opinion", "tata for now", "as known as", "also known as", "see you later", "see you", "for your information", "in my opinion", "too good to be true", "best friends forever", "best friend forever", "best friends", "best friend", "definitely", "been", "hello", "i am", "night", "when", "some", "to", "speak", "you", "your", "for", "friend", "people", "see", "be", "and", "&", "anyone", "because", "are", "bate", "date", "fate", "great", "hate", "late", "mate",
@subtleGradient
subtleGradient / git-jira
Created December 17, 2010 00:16
Jira CLI with git config support! + stuff
#!/usr/bin/env bash
# Author: Thomas Aylott <thomas@subtlegradient.com>
# Usage:|
# git-jira getIssue
# git-jira getComments
# Notes:|
# This expects you to use branch names like "thomas/HUE-123-Make-Things-Awesomer" or "tom-HUE-321-code-stuff"
BRANCH_NAME="$(git symbolic-ref HEAD|sed 's/refs\/heads\///')"
TICKET_ID="$(echo "$BRANCH_NAME"|sed -E 's/^.*[/-]([A-Z]+-[0-9]+).*$/\1/')"
@dave1010
dave1010 / 00-the-wordpress-way.md
Created August 18, 2011 09:21
The WordPress Way - The 10 rules of WordPress development

The WordPress Way

A tongue-in-cheek look at coding standards in the WordPress core and the average WordPress plugin.

  1. # Declare variables global - in case they're going to be used again
  2. All function/method parameters should be strings (e.g. 'yes'/'no') - for clarity
  3. Functions and methods should return mixed types
  4. No need to separate PHP logic from HTML, JS or CSS
  5. Don't worry about PHP Notices - they're not important
@UnderpantsGnome
UnderpantsGnome / pre-commit
Last active September 27, 2015 00:47
My pre-commit hook
#!/bin/bash
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"
@dave1010
dave1010 / htaccess
Created December 14, 2011 13:07
HTTP Status Cats Apache (htaccess) config
# HTTP Status Cats
# Apache (htaccess) config created by @dave1010
# Licensed CC BY 2.0
# Images CC BY 2.0, from GirlieMac's photostream:
# http://www.flickr.com/photos/girliemac/sets/72157628409467125/with/6508023065/
# 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>'
@CHH
CHH / .gitignore
Created August 2, 2011 21:09
PHP Templating Engine with bindable $this support in 53 LOC
vendor/
composer.lock
@winhamwr
winhamwr / tutorial.md
Created June 4, 2012 22:37
Creating a repeatable, dynamic site to site VPN with OpenSwan on Ubuntu 10.04 from Amazon EC2

Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham winhamwr@gmail.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.