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 / 0_reuse_code.js
Created May 5, 2016 20:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@olets
olets / link.twig
Last active May 2, 2018 19:57
link in #hifi
@olets
olets / domain-from-url.twig
Last active November 4, 2024 09:38
get the domain from a url
{% set no_protocol = url|split('//')[1] ?: url %}
{% set only_domains = no_protocol|split('/')[0] ?: no_protocol %}
{% set url_domain = '' %}
{% if only_domains|split('.')[2] %}
{% set url_domain = only_domains|split('.')[1] %}
{% else %}
{% set url_domain = only_domains|split('.')[0] %}
{% endif %}
@olets
olets / flip-name.twig
Last active May 2, 2018 19:57
flip-name: go from LAST, FIRST to FIRST LAST
{#
A twig snippet to change
LASTNAME[, OPTIONALSUFFIX], FIRSTNAME
into
FIRSTNAME LASTNAME[, OPTIONALSUFFIX]
`include` with whitespace removed
e.g. {%- include 'flip-name.html' -%}
@olets
olets / max_width_email.html
Last active May 12, 2016 21:37 — forked from elidickinson/max_width_email.html
Email Template trick: max-width with outlook
<!--[if mso]>
<table cellpadding="0" cellspacing="0" border="0" style="padding:0px;margin:0px;width:100%;">
<tr><td colspan="3" style="padding:0px;margin:0px;font-size:20px;height:20px;" height="20">&nbsp;</td></tr>
<tr>
<td style="padding:0px;margin:0px;">&nbsp;</td>
<td style="padding:0px;margin:0px;" width="560">
<![endif]-->
<!-- PLACE CONTENT HERE -->
@olets
olets / social_sharers.css
Last active March 24, 2017 20:17
popup windows for sharing the current site on various social platforms
.social_sharers svg {
height: 40px;
}
@olets
olets / CopyCleaner.applescript
Created March 26, 2017 03:03 — forked from robjwells/CopyCleaner.applescript
BBEdit & TextWrangler text clean-up script for the Morning Star newspaper
-- By Rob Wells for the Morning Star
on open theStories
repeat with aStory in theStories
tell application "TextWrangler"
open aStory
tell the front text document
set encoding to "Unicode (UTF-8)"
educate quotes with replacing target
@olets
olets / README.md
Created August 31, 2017 18:53
Responsive Page Text

Responsive font-size and line-height mixins

Mixins for LESS and Sass (.scss) to make all page text —font sizes and line heights— responsive

Set your font-sizes and line-heights with these mixins, set a mobile scale factor, and all text on your page will scale down automagically.

Want some text to scale differently? Use a media query to give that text a different full-size value for mobile.

Want some text to always stay the same size? Want some text to keep its font size while scaling its line height? Want some text to keep its line height while scaling its font size? Just don't use the mixin for the things you want to keep constant, or override the mixin with an explicit style.

@olets
olets / git-cleanup-repo
Last active May 2, 2018 19:58 — forked from robmiller/git-cleanup-repo
A script for cleaning up #git repositories; it deletes branches that are fully merged into `origin/master`, prunes obsolete remote tracking branches, and as an added bonus will replicate these changes on the remote.
#!/bin/bash
# git-cleanup-repo
#
# Author: Rob Miller <[email protected]>
# Adapted from the original by Yorick Sijsling
git checkout master &> /dev/null
# Make sure we're working with the most up-to-date version of master.
git fetch
@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 | [email protected] | 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