Skip to content

Instantly share code, notes, and snippets.

View olets's full-sized avatar
:shipit:

Henry Bley-Vroman olets

:shipit:
View GitHub Profile
@olets
olets / past-present-or-future.twig
Created January 6, 2020 21:33
Twig: Determine if a date is past, present, or future
https://twigfiddle.com/ujg6hr
{% macro when(theDate = 'now', precision = 'd F Y') %}
{% set difference = 'now'|date(precision)|date('U') - theDate|date(precision)|date('U') %}
{{ difference == 0 ? 'now' : (difference > 0 ? 'past' : 'future') }}
{% endmacro %}
{% set currentDay = 'now'|date('d') %}
{% set currentMonth = 'now'|date('F') %}
{% set currentYear = 'now'|date('Y') %}
@olets
olets / mamp-php-on-macos-command-line.sh
Last active February 6, 2020 19:06
Make all MAMP PHPs available on command line, and default to the latest
# Henry Bley-Vroman, 2019
#
# Usage
# Paste or source this into your shell profile.
# Requires macOS and that your shell supports [[ ]] and '<string> == <starting substring>*'
# (Bash, Zsh, Ksh etc)
# alias php to the latest PHP installed with MAMP
MAMP_PHP__LATEST=$(ls /Applications/MAMP/bin/php/ | sort -V | tail -1)
alias php="/Applications/MAMP/bin/php/${MAMP_PHP__LATEST}/bin/php -c \"/Library/Application Support/appsolute/MAMP PRO/conf/${MAMP_PHP__LATEST}.ini\""
@olets
olets / local-package-as-dependency.md
Last active January 6, 2020 03:43
Use local packages as dependencies
@olets
olets / README.markdown
Last active September 28, 2018 19:03
Gappy Grid

Gappy Grid is a flexbox grid system for building grids that have equal-width columns, equal-height rows, outer columns flush with the container's sides.

It supports arbitrary column gaps and row gaps, and breakpoint-specific column counts and gap sizes.

It has been tested on the oldest browsers I had handy access to when writing it: Chrome 68, Edge 14, Firefox 61, IE 11, Opera 51, Safari 11, and Safari on iOS 9.

Sassmeister: https://www.sassmeister.com/gist/e99c2a0ed632a8d8bafb8e81961f96bd

Codepen: https://codepen.io/henry/pen/dqYzEW?editors=1100

@olets
olets / 1--responsive-sizing-and-spacing.scss
Last active August 2, 2018 21:14
Sass styles for responsive sizing and spacing
// ----
// Sass (v3.4.25)
// Compass (v1.0.3)
// ----
// VARIABLES
$widths: (
// devices
tablet-to-mobile: 768px//,
@olets
olets / README.md
Last active July 17, 2018 00:52
Simple Sass media query system and multi-stop grid system

Simple Sass media query system and multi-stop grid system

Pen: https://codepen.io/henry/pen/JBXMgB

  1. Include (@import, or just paste in) the variables-- Sass files, and then the functions-- Sass files.
  2. Use them!
  • Media queries: in Sass, @include media(<one of the keys in $queries>) {…}
  • Grid:
    • Markup (Pug, in this demo)
@olets
olets / globals-in-twig.md
Last active July 10, 2023 17:21
Global variables in Twig
@olets
olets / arpanet-maps.md
Last active October 23, 2020 20:38
ARPANET Maps

Compiled from http://som.csudh.edu/fac/lpress/history/arpamaps/ and https://en.wikipedia.org/wiki/ARPANET

These maps are from Heart, F., McKenzie, A., McQuillian, J., and Walden, D., ARPANET Completion Report, Bolt, Beranek and Newman, Burlington, MA, January 4, 1978.


Folks -- I just scanned these in. They are too big, but right now I do not have the time to reduce them and try filtering out the noise. If someone does, please let me know. Larry (source: http://som.csudh.edu/fac/lpress/history/arpamaps/)

@olets
olets / nvm-ls-g
Last active May 19, 2021 15:44
List global packages for all nvm Nodes
#!/usr/bin/env sh
# nvm-ls-g
# Henry Bley-Vroman
# MIT License, 2018
# Lists the globally-installed npm packages
# for every nvm-installed version of Node
# Usage:
@olets
olets / post-commit
Last active May 2, 2018 19:58 — forked from lmullen/post-commit
A script to log commits from a #git hook
#!/usr/bin/env ruby
# Write git commit messages to a log file
#
# Lincoln A. Mullen | lincoln@lincolnmullen.com | http://lincolnmullen.com
# MIT License <http://lmullen.mit-license.org/>
# Fork by Henry Bley-Vroman / @olets
#
# You will have to install the git gem for this to work:
# gem install git