Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View pborenstein's full-sized avatar

Philip Borenstein pborenstein

View GitHub Profile
@pborenstein
pborenstein / index.html
Created July 27, 2020 03:30
minimal — User controlled dark mode
<main>
<article>
<h1>Dark mode should be a user preference—not presumed</h1>
<p>Yes, by default, when a user has <code>@media (prefers-color-scheme: dark)</code> set, we should set a dark theme, but we should also provide a switch for if the dark them isn’t working out for them.</p>
<p>This also benefits users that don’t have <code>@media (prefers-color-scheme: dark)</code> set because they get a toggle to choose, too.</p>
</article>
<div class="user-toggle">
<button class="toggle">
toggle
</button>
@pborenstein
pborenstein / list-table.css
Last active January 30, 2021 18:00
Use Markdown lists to describe tables
/****
list-table
Make Markdown lists behave as a table.
https://www.pborenstein.com/articles/tablehacks/
Usage:
<div class="list-table extra" markdown="1">

Keybase proof

I hereby claim:

  • I am pborenstein on github.
  • I am pborenstein (https://keybase.io/pborenstein) on keybase.
  • I have a public key whose fingerprint is B2BA ADE0 A50E CB2A 0326 067A C30C 080A AF31 F14B

To claim this, I am signing this object:

@pborenstein
pborenstein / fontawesome.txt
Last active January 8, 2016 20:49
How to use font-awesome glyphs with the RDT theme
How to use font-awesome glyphs in sphinx
========================================
.. comment
Put the following lines somewhere in your file.
.. |folder-open| raw:: html
<span class="fa fa-folder-open" style="color: red;"></span>
@pborenstein
pborenstein / Colorfn Notes.txt
Last active August 29, 2015 14:05
Color functions
From: http://misc.flogisoft.com/bash/tip_colors_and_formatting
This is working for me for now (it's only lightly tested, fails gracefully if the numbers are too high, fails ungracefully if you give too few arguments, and uses features in bash new to me (hey, been away for awhile), so not sure if they are standard or new... with that out of the way:
Now I can do things like echo "$(c_grey 15)I'm light Grey$(c_clr)" and
echo "$(cb_rgb 5 0 0)Red$(cb_rgb 0 5 0)Green$(cb_rgb 0 0 5)Blue$(c_clr)"
At any rate, hope this helps someone.
@pborenstein
pborenstein / colorsxterm.sh
Created August 10, 2014 03:49
Print all the xterm colors
#! /usr/bin/env bash
# print all the xterm colors
# see http://serverfault.com/a/91873 about caculating the rgb values
for c in {0..15}
do
printf "\033[38;5;%dm %2d" $c $c
if (( (c+1) % 8 == 0 )) ; then
@pborenstein
pborenstein / mantwin.md
Last active January 21, 2020 15:30
Running Joyent Manta on Windows
@pborenstein
pborenstein / tkbug.js
Last active August 29, 2015 13:57
node-tokenizer bug
var Tokenizer = require('tokenizer');
t = new Tokenizer();
t.addRule(/^{\w+}$/, 'curlytoken');
t.addRule(Tokenizer.whitespace);
t.addRule(Tokenizer.word);
t.on('token', function (token, type) {
console.log('%s %s', token, type);
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
# Modified for base[64] 1.8.4
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
cd /tmp
pkgin -y install ruby193-chef
fi