Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
@getify
getify / 1.json
Created September 11, 2012 06:21
how does your templating approach handle this task?
{
"settings" : {
"foo" : "low",
"bar" : "high",
"baz" : "low"
}
}
@melanke
melanke / README.md
Created August 28, 2012 21:57
JQuery RedditLoader - smart and customizable reddit content loader
@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 = [email protected]: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:

@pbiggar
pbiggar / gist:3166676
Created July 23, 2012 22:35
Sample circle.yml file
########################
# Customize the test machine
########################
machine:
# Set the timezeone - any value from /usr/share/zoneinfo/ is valid here
timezone:
America/Los_Angeles
# Version of ruby to use
@phred
phred / pedantically_commented_playbook.yml
Last active February 26, 2025 14:19
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@rwaldron
rwaldron / device.js
Created May 17, 2012 17:04
Traceur Experiments: class constructor
// For context, See original: https://gist.github.com/2654256
class Device {
constructor( opts ) {
this.value = null;
// open an async stream,
// this will be called continuously
language: python
python:
- "2.6"
- "2.7"
env:
- DJANGO=1.2.7 SUITE=tests
- DJANGO=1.3.1 SUITE=tests
- DJANGO=1.4 SUITE=tests
- DJANGO=1.4 SUITE=lint
install:
@masak
masak / explanation.md
Last active April 10, 2025 16:42
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Inspired by Robert O'Callahan's blog

To reduce the need for "visual confirmation" tests:

  • store the base-64 encoded data-uri of a reference png as a string
  • copy the outerHTML of your test fixture into an SVG wrapper, prefixed with "data:image/svg+xml,"
  • set the src of an image to the value of the SVG wrapper
  • copy the image into a canvas context
  • assert equality of canvas.context.toDataURL() and previously stored reference string