Skip to content

Instantly share code, notes, and snippets.

View teddyzetterlund's full-sized avatar

Teddy Zetterlund teddyzetterlund

View GitHub Profile
@teddyzetterlund
teddyzetterlund / gist:7245945
Created October 31, 2013 08:16
Print and sort minitest result test times by longest time to run.
ruby -Ilib test/test_meta.rb -v | sort -k2 -t= -nr | head -3
@teddyzetterlund
teddyzetterlund / sitemap.xml
Last active December 29, 2015 02:28
Jekyll Sitemap. Usage: Put this in `./sitemap.xml` and make sure you have `url` and `author` in your `_config.yml`.
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>{{ site.url }}</loc>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
@teddyzetterlund
teddyzetterlund / atom.xml
Created November 22, 2013 14:04
Jekyll Feed. Usage: Put this in `./atom.xml` and make sure you have `url` and `author` in your `_config.yml`.
---
layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text" xml:lang="en">{{ site.name }}</title>
<link type="application/atom+xml" href="{{ site.url }}/feed/" rel="self"/>
<link type="text" href="{{ site.url }}" rel="alternate"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
/* ./modules/button.css.scss */
/* The SCSS Way (~16 lines) */
.button {
border-radius: 0.25em;
padding: 0.5em;
@include modifier('big') {
padding: 2em;

OAIJ (Oat In A Jar)

Kalorisnål och proteinfylld frukost/mellis.

Låt stå över natten (i en tilltäppt burk).

Standard

  • 1,25 dl havregryn
  • 1,5 dl lättkesella/kvarg

In the light of @dhh's recent presentation at #railsconf you do well in remembering this section from @37signals' book Getting Real:

“You take too much of a black and white view.”

If our tone seems too know-it-allish, bear with us. We think it’s better to present ideas in bold strokes than to be wishy-washy about it. If that comes off as cocky or arrogant, so be it. We’d rather be provocative than water everything down with “it depends...” Of course there will be times when these rules need to be stretched or broken. And some of these tactics may not apply to your situation. Use your judgement and imagination.

@teddyzetterlund
teddyzetterlund / clipboard-to-omnifocus-inbox.scpt
Last active August 29, 2015 14:00
Adds a task directly to the OmniFocus inbox for each paragraph in the current clipboard.
set _clipboard to get the clipboard
set _tasks to paragraphs of _clipboard
tell application "OmniFocus"
tell default document
repeat with _task in _tasks
make new inbox task with properties {name:_task}
end repeat
end tell
end tell
if (
'querySelector' in document &&
'localStorage' in window &&
'addEventListener' in window
) {
return true;
}
/**
* base/box-sizing
*
* Apply a natural box layout model to all elements while respecting
* plugins or other components that leverage other behavior.
*
* http://www.paulirish.com/2012/box-sizing-border-box-ftw/
* http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
*/