Skip to content

Instantly share code, notes, and snippets.

View knuton's full-sized avatar
🌱

Johannes Emerich knuton

🌱
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 3, 2024 13:01
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@juliocesar
juliocesar / awesome_router.coffee
Created May 21, 2012 17:00
AwesomeRouter: a cool Backbone.js router class
# AwesomeRouter: A class that I've been using throughout a few Backbone.js apps I've built.
#
# It adds 2 features: an event that gets fired when one calls `navigate` (aptly named
# "navigate"), so you can bind things to when a URL gets triggered. And a "before filter"
# method `before`, which you can use to run things before every a route gets triggered.
#
# This could easily be extended to have after filters too, or to only trigger a route
# upon @before returning something that's not false.
class AwesomeRouter extends Backbone.Router
@LeaVerou
LeaVerou / dabblet.css
Created April 17, 2012 05:57
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@andyhd
andyhd / lens.js
Created February 11, 2012 01:48
Javascript Lenses
function lens(get, set) {
var f = function (a) { return get(a); };
f.set = set;
f.mod = function (f, a) { return set(a, f(get(a))); };
return f;
}
var first = lens(
function (a) { return a[0]; },
function (a, b) { return [b].concat(a.slice(1)); }
@subtleGradient
subtleGradient / commonjs_app.js
Created January 4, 2010 14:36
CommonJS: Extending native prototypes from a module
require('footools').setup(Array, Boolean, Function, Number, RegExp, String);
"bar".foo(); // no Fail