Skip to content

Instantly share code, notes, and snippets.

View mrgenixus's full-sized avatar

Ben West mrgenixus

View GitHub Profile
@mrgenixus
mrgenixus / ctrr.md
Created October 25, 2012 19:57 — forked from esmooov/ctrr.md
Carats and Tildes, Resets and Reverts

Until last night I lived in fear of tildes, carats, resets and reverts in Git. I cargo culted, I destroyed, I laid waste the tidy indicies, branches and trees Git so diligently tried to maintain. Then Zach Holman gave a talk at Paperless Post. It was about Git secrets. He didn't directly cover these topics but he gave an example that made me realize it was time to learn.

A better undo

Generally, when I push out bad code, I panic, hit git reset --hard HEAD^, push and clean up the pieces later. I don't even really know what most of that means. Notational Velocity seems to be fond of it ... in that I just keep copying it from Notational Velocity and pasting it. Turns out, this is dumb. I've irreversibly lost the faulty changes I made. I'll probably even make the same mistakes again. It's like torching your house to get rid of some mice.

Enter Holman. He suggests a better default undo. git reset --soft HEAD^. Says it stag

@mrgenixus
mrgenixus / Gemfile
Created March 28, 2012 02:13 — forked from davidjbeveridge/attribute_observers.rb
Attribute Observers
source "http://rubygems.org"
gem "json"
@mrgenixus
mrgenixus / config
Created January 31, 2012 04:05 — forked from davidjbeveridge/Gemfile
Routing
---
BUNDLE_PATH: json
BUNDLE_DISABLE_SHARED_GEMS: '1'
@mrgenixus
mrgenixus / README.md
Created August 15, 2011 05:41 — forked from davidjbeveridge/README.md
wtf.sh

wtf.sh

A simple search for when you find yourself typing wtf on the command line. Works on mac.

Instructions

Put this somewhere in your path, make it executable, and either rename it to wtf, or create a symlink. Then, whenever you type wtf on the command line, you'll actually get something.

<html>
<head>
<link rel="stylesheet" href="https://raw.github.com/harvesthq/chosen/master/chosen/chosen.css" />
</head>
<body>
<form>
<select name='Organization' class='chzn-select'><option value=''></option><option value='Our Company'></option><option value='Test Company'></option>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script src="https://github.com/harvesthq/chosen/blob/master/chosen/chosen.jquery.js" type="text/javascript"></script>