Skip to content

Instantly share code, notes, and snippets.

@cbfrance
cbfrance / texture.html
Created August 25, 2015 06:13
canvas texture
<canvas style="background: red;" width="600px" height="600px"></canvas>
<script>
var cx = document.querySelector("canvas").getContext("2d");
function branch(length, angle, scale) {
cx.fillRect(0, 0, 1, length);
if (length < 10) return;
cx.save();
cx.translate(0, length);
cx.rotate(-angle);
branch(length * scale, angle, scale);
@keyframes gradient {
0%{background-position:0% 0%}
10%{background-position:10% 15%}
20%{background-position:20% 25%}
30%{background-position:30% 35%}
40%{background-position:40% 45%}
50%{background-position:50% 55%}
60%{background-position:60% 65%}
70%{background-position:70% 75%}
80%{background-position:80% 85%}
input[type='email'] {
width: 68%;
&:focus {
// outline: 1px dotted;
border-bottom: 1px solid $dodger-blue;
}
// When clicking in this element, light up the button
&:focus ~ input[type='submit'] {
  • a task list item
  • list syntax required
  • normal formatting, @mentions, #1234 refs
  • incomplete
  • completed
@cbfrance
cbfrance / filter.sh
Last active April 22, 2017 01:05
Truncate a repo at an arbitrary point
git filter-branch --parent-filter '
read parent
if [ "$parent" = "-p <COMMIT ID>" ]
then
echo
else
echo "$parent"
fi'
@cbfrance
cbfrance / .travis.yml
Created April 26, 2017 00:30
Slimer on Travis
language: ruby
rvm:
- 2.3.3 #reasonably recent
env:
- SLIMERJSLAUNCHER=$(which firefox) DISPLAY=:99.0 PATH=$TRAVIS_BUILD_DIR/slimerjs:$PATH #for slimer
addons:
firefox: "50.0" # for slimer
cache: bundler # Cache rubygems to speed up the build
before_script:
- . $HOME/.nvm/nvm.sh # Enable node installation
@cbfrance
cbfrance / count_rules.sh
Created May 23, 2017 21:46
histogram of common rules in a set of stylesheets
brew install distribution
cat src/app/**/*css | sed 's/^[ ]*//' | sed 's/[ ]*$//' | sed 's/{//' | sed 's/}//' | sed 's/[//]//' | sed 's/[/]//' | sed 's/\*//' | sort -nr | uniq -c | sort -n | distribution -g=vk --height=200 --color --width=100
@cbfrance
cbfrance / find-largest-sass.sh
Created May 23, 2017 21:48
histogram of largest sass files
brew install distribution
wc -l src/app/**/*css | sed '$ d' | distribution --graph=vk --color --height=1000 --width=120 --char=ba
openapi: 3.0.0
# Layer.City API Spec
servers:
- description: Layer.city API
url: https://api-dev.layer.city
info:
description: Geocoding as it was meant to be - no subscriptions, no maximums, no work.
version: "0.1"
title: layer.city
contact:
@cbfrance
cbfrance / cloudSettings
Last active March 22, 2020 23:05
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-03-22T23:05:43.085Z","extensionVersion":"v3.4.3"}