Skip to content

Instantly share code, notes, and snippets.

View dannydb's full-sized avatar

Danny DeBelius dannydb

View GitHub Profile
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@brianboyer
brianboyer / gist:1696819
Created January 29, 2012 02:21
Lion dev environment notes
@twosixcode
twosixcode / gist:1988097
Created March 6, 2012 18:40
Make "Paste and Indent" the default paste in Sublime Text 2
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
@andrewrocco
andrewrocco / check.html
Created April 24, 2012 17:55
CSS Media Check
<!doctype html>
<html>
<head>
<title>CSS Media Check</title>
<style type="text/css">
#mediaquery{
-webkit-transition: width .001s;
-moz-transition: width .001s;
@brianboyer
brianboyer / gist:2648545
Created May 9, 2012 20:25
Applescript for PowerMate that resizes a window for responsive web design testing
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) + 100
set size to {newWidth, item 2 of oldSize}
end tell
@esmooov
esmooov / ctrr.md
Created May 25, 2012 16:50
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

@esmooov
esmooov / checkout.md
Created May 31, 2012 15:54
The Secret Passions of Git Checkout

The Secret Passions of Git Checkout


The Hand of God

Master Hand

Git checkout can do almost anything ... or, at least, many things. It can switch branches. It can mix and match branches. It can resolve merge conflicts. It can give you a scratchpad to test things. It can even be used to interactively patch files. It's so powerful because it's so abstract. But much like numinous mystics, abstraction makes it confusing.

Basically git checkout does two things:

@harrisj
harrisj / article_fetcher.rb
Created June 22, 2012 20:16
Basic code for the nytimes_ebooks
# encoding: UTF-8
require 'rubygems'
require 'rest-client'
require 'nokogiri'
class ArticleFetcher
def self.fetch_text(url)
case url
when /video\.nytimes\.com/
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jeremyjbowers
jeremyjbowers / red_velvet_cake.md
Last active March 30, 2022 17:33
Georgia Red Velvet Cake

Red Velvet Cake

Red Velvet cake recipe Red Velvet cake finished

Cake

Ingredients

From original recipe