Skip to content

Instantly share code, notes, and snippets.

View davidpaulsson's full-sized avatar

David Paulsson davidpaulsson

View GitHub Profile
@davidpaulsson
davidpaulsson / index.js
Created November 6, 2021 13:14 — forked from jadenlemmon/index.js
Example A/B Test Gatsby v4 SSR Cookies
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,
@davidpaulsson
davidpaulsson / render_time.rb
Last active August 29, 2015 13:57 — forked from blakesmith/render_time.rb
Displays the time a Jekyll page was generated in format "Month DD, YYYY"
# 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)