Skip to content

Instantly share code, notes, and snippets.

@ricog
ricog / gist:1684813
Created January 26, 2012 20:13
Vim EOL fix
" http://vim.wikia.com/wiki/VimTip1369
" Preserve noeol (missing trailing eol) when saving file. In order
" to do this we need to temporarily 'set binary' for the duration of
" file writing, and for DOS line endings, add the CRs manually.
" For Mac line endings, also must join everything to one line since it doesn't
" use a LF character anywhere and 'binary' writes everything as if it were Unix.
" This works because 'eol' is set properly no matter what file format is used,
" even if it is only used when 'binary' is set.
@ricog
ricog / gist:1584681
Created January 9, 2012 20:10
Better Git Workflow

This describes a fairly simple git workflow where features are developed on descriptively named branches. These branches are pushed to github and merged into master once completed and tested by someone else. This is very similar to github flow.

Committing Changes

  1. Make some changes

  2. Commit to a new descriptively named branch

@ricog
ricog / basic-git-workflow
Created January 9, 2012 20:01
Basic Git Workflow
## Installation
get the files
git clone <repo url>
## Working on files
see what you've changed
git diff
@ricog
ricog / gist:1348166
Created November 8, 2011 15:56
Split long if statements onto several lines
<?php
if (
$something === true &&
$something_else === false
) {
//code here
}
?>