I hereby claim:
- I am davidpaulsson on github.
- I am davidpaulsson (https://keybase.io/davidpaulsson) on keybase.
- I have a public key whose fingerprint is 7F6E 0C62 26CB 9F49 B685 3C63 2246 ACB6 100C 1333
To claim this, I am signing this object:
import { sample } from 'lodash'; | |
import React from 'react'; | |
import cookie from 'cookie'; | |
import Layout from '../components/layout'; | |
import HomeV1 from '../components/scenes/home/v1'; | |
import HomeV2 from '../components/scenes/home/v2'; | |
const EXPERIMENT_OPTIONS = { | |
v1: HomeV1, | |
v2: HomeV2, |
/*-------------------------------------------------------------- | |
Flexbox grid | |
--------------------------------------------------------------*/ | |
// Wrapper | |
.grid { | |
display: flex; | |
} | |
// Alignment per row |
Verifying that +davidpaulsson is my openname (Bitcoin username). https://onename.com/davidpaulsson |
I hereby claim:
To claim this, I am signing this object:
/* | |
* CSS needed for https://gist.github.com/davidpaulsson/10101172 | |
*/ | |
img { | |
max-width: 100%; | |
height: auto; | |
} | |
/* Non-fluid images if you specify `width` and/or `height` attributes. */ |
/** | |
* Place this inline at the bottom of the html document, right before | |
* closing `</body>`. It's important to have this inline as we want to | |
* display images asap. | |
* | |
* Markup example for the actual images. It also calculates the image | |
* container using the [padding-top hack](https://gist.github.com/davidpaulsson/10101985), | |
* please do this calculation on the back end, before drawing the DOM. | |
* Current example can load three images sizes, customize to fit your needs. It | |
* also adds the calculated image URL as an data-original tag on the img element it creates, |
# An example Jekyll Liquid tag. Utilizes the new plugin system. | |
# | |
# 1. Make a _plugins directory in your jekyll site, and put this class in a file there. | |
# 2. In anyone of your pages, you can use the 'render_time' liquid tag like so: | |
# {% render_time Page generated at: %} | |
module Jekyll | |
class RenderTimeTag < Liquid::Tag | |
def initialize(tag_name, text, tokens) |
// Usage: | |
// get_id_by_slug('any-page-slug'); | |
function get_id_by_slug($page_slug) { | |
$page = get_page_by_path($page_slug); | |
if ($page) { | |
return $page->ID; | |
} else { | |
return null; | |
} |
# open a file in chrome | |
# usage: $ chrome index.html | |
function chrome() { | |
open $@ --args --allow-file-access-from-files | |
} |
var maxHeight = 0; | |
$('div').each(function(){ | |
if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } | |
}); | |
$('div').height(maxHeight); |