Skip to content

Instantly share code, notes, and snippets.

View trotzig's full-sized avatar

Henric Trotzig trotzig

View GitHub Profile
@trotzig
trotzig / gist:7048039
Created October 18, 2013 20:47
Script to check commit messages for alliterations.
.
@trotzig
trotzig / Byte abuse
Last active August 29, 2015 13:57
This story was posted to leaveastory.com on March 8, 2014.
It wasn't the first time I had woken up in the middle of the night thinking about it. To be honest, I'd been sleeping terribly for over a week. All I could think of was to have it. Just a small fix, and then I'd go back to sleep. I know it wasn't healthy, but I couldn't do anything about it. In my mind, it wasn't a physical addiction. My body just needed it.
The kitchen was dark apart from a light that I'd intentionally left on before going to bed. Traces of previous sessions were scattered over the kitchen table. Soda cans and empty energy bar packages took up most of the space. I had come to understand that by adding lots of energy in the form of sugar I was able to sustain the effect a lot longer than I would have without the carbohydrates.
The first part of a session, which I called "the prep phase", included ssh-ing into a virtual cluster hosted on a remote island outside the coast of The Phillipines. You might call this "early tripping", but for me it was a means to an end, not the actual thing. What
# This is a list of matchers that we use in our RSpec tests at Causes.
# *** CAPYBARA MATCHERS ***
#
# To check for content on a page, don't use `include`, use `have_content`:
response.body.should have_content 'A header'
# As opposed to `include`, this Capybara matcher will only look for content
# (ignoring tags and meta-info etc). And the error message is slightly easier to
@trotzig
trotzig / face_pile_positions_csv2css.rb
Last active August 29, 2015 14:01
Conversion script for Face Pile positions
require 'csv'
# Script used to convert the face pile positioning document Nebs put together in
# https://docs.google.com/a/causes.com/spreadsheets/d/1ELRK8J0I8Q-Hu8-mPIYvOxW0_cNDxvg35QNLzSrTIT8/edit
#
# I made a copy of this document and cleaned it to make it easier to parse:
# https://docs.google.com/a/causes.com/spreadsheets/d/1Ye2o-exOj1JsMPeeWiOk3s4HQ7UBtGlO1t2zSEUECbc/edit
# This is the document used in this script.
styles = {}
<div class="chip">
<img class="chip__img" src="http://api.randomuser.me/portraits/med/women/56.jpg">
<div class="chip__info">
<h3 class="chip__info-name">Jane Doe</h3>
<div class="chip__info-email">jane.doe@brigade.com</div>
</div>
<button class="chip__action">×</button>
</div>
/**
* We need to clear floats for the container so that it wraps
* the content nicely.
*
* Clearfix technique from http://nicolasgallagher.com/micro-clearfix-hack/
*/
.chip:before,
.chip:after {
content: " ";
display: table;

Keybase proof

I hereby claim:

  • I am trotzig on github.
  • I am henric (https://keybase.io/henric) on keybase.
  • I have a public key whose fingerprint is EC58 B9C8 9827 6856 7E00 B8A7 4C5B 3FD4 7166 FDEE

To claim this, I am signing this object:

@trotzig
trotzig / SassMeister-input-HTML.html
Created October 5, 2014 08:31
Generated by SassMeister.com.
<div class="bike">
<div class="wheel wheel--front">
<div class="spoke spoke--0"></div>
<div class="spoke spoke--1"></div>
<div class="spoke spoke--2"></div>
<div class="spoke spoke--3"></div>
<div class="spoke spoke--4"></div>
</div>
<div class="wheel wheel--back">
<div class="spoke spoke--0"></div>
@trotzig
trotzig / SassMeister-input-HTML.html
Last active August 29, 2015 14:07
Generated by SassMeister.com.
<div class="bike">
<div class="wheel wheel--front">
<div class="spoke spoke--0"></div>
<div class="spoke spoke--1"></div>
<div class="spoke spoke--2"></div>
<div class="spoke spoke--3"></div>
<div class="spoke spoke--4"></div>
</div>
<div class="wheel wheel--back">
<div class="spoke spoke--0"></div>
# Converts global chained `var`s into single-line vars.
#
# Example:
#
# >> cat test.js
# var A = require('a'),
# B = require('b'),
# C = B.C;
#
# var D = function() {};