Skip to content

Instantly share code, notes, and snippets.

View danderozier's full-sized avatar

Daniel Derozier danderozier

View GitHub Profile
@danderozier
danderozier / application_form.rb
Last active March 17, 2020 16:22
A simple Rails form object built atop dry-validation
# frozen_string_literal: true
# A simple Rails form object built on top of dry-validation.
#
# @example
#
# class WidgetForm < ApplicationForm
#
# # Use the Dry::Validation::Contract DSL.
# params do
# Provides a simple DSL to define a set of attributes to be extracted from
# an object, inspired by ActiveModel::Serializers.
#
# Attributes defined as symbols will first look for a local method before
# being delegated to the provided object; an optional block may be provided.
#
# @example
#
# class ContactPresenter < AttributePresenter
# attributes :first_name, :last_name, :phone_number

Keybase proof

I hereby claim:

  • I am danderozier on github.
  • I am derozier (https://keybase.io/derozier) on keybase.
  • I have a public key ASBTP-IgMmyu5DyQarfmMo8aX38uY-s35zESVWflxo-7-Qo

To claim this, I am signing this object:

ul, li {
display: inline;
}
li {
&::after {
content: ', ';
}
&:last-child::before {
@danderozier
danderozier / gist:1200b4f7184c79e7fb3395ce08a91340
Last active June 23, 2016 22:23 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body {
background: #eee;
color: #333;
font: 1.5em/1.2 Helvetica, sans-serif;
margin: 0 auto;
}
h1 {
@danderozier
danderozier / SassMeister-input-HTML.haml
Created June 26, 2015 19:11
Generated by SassMeister.com.
.layout.layout--1-column
.main
.content
%p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc lectus risus, congue a lectus a, aliquet rutrum dui. Aenean et dictum mauris, sed eleifend nunc. Ut ac vehicula augue. Pellentesque ut ante in libero rhoncus sodales et in orci. Phasellus vulputate placerat massa, pulvinar pharetra turpis tincidunt eget. In dui lorem, hendrerit vel maximus vitae, lobortis eget nunc. Sed dolor lacus, pellentesque quis interdum et, tincidunt quis magna. Cras interdum accumsan velit in convallis. Ut vitae fringilla ante. Nulla vel sem hendrerit, ullamcorper nisi vel, semper odio.
%figure.media.align--center
%img{ src: 'http://placehold.it/400x200' }
%figcaption
%p I’m a centered image that’s smaller than the layout
%p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc lectus risus, congue a lectus a, aliquet rutrum dui. Aenean et dictum mauris, sed eleifend nunc. Ut ac vehicula augue. Pellentesque ut ante in libero
@danderozier
danderozier / SassMeister-input-HTML.haml
Created June 25, 2015 15:49
Generated by SassMeister.com.
.i-row
.item
.item__thumb
%img{ src: 'http://www.fillmurray.com/600/400' }
.item__body
.item__kicker Kicker
.item__title The 10 Most Persistent Beliefs About Seattle Dining
.item__teaser Which are true, which are not? The 10 most persistent beliefs about seattle dining are a thingus
.item__meta By Kathryn Robinson &bull; Published 10/25/2015