Skip to content

Instantly share code, notes, and snippets.

@unruthless
unruthless / CSS for <sup> and <sub>
Created May 26, 2010 01:31
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@unruthless
unruthless / gist:11383824
Last active January 3, 2024 08:57
HTML Email Template guidelines

General guidelines for designing HTML email templates.

Questions and comments welcome anytime – thanks for reading!

KEY TAKEAWAY:

  • Coding for HTML emails is like coding for Internet browsers from 10 years ago. (It’s the email clients’ — Outlook, etc. — fault.)
  • Picture a website from a decade ago: that’s the level of design complexity we can reasonably shoot for.

WIDTH:

@unruthless
unruthless / gist:4061083
Created November 12, 2012 18:38
Kill rails process
$ lsof -wni tcp:3000
$ kill -9 PID
@unruthless
unruthless / mq-boilerplate.css
Last active July 5, 2016 10:11
Media Query Boilerplate
/**
* Target styles based on screen color support
*/
/* Screen is in monochrome */
@media (monochrome) {
}
/* Screen is in color */
@media (color) {
/*
Morsino
Flashes the morse code of the clicked letter.
This example code is in the public domain.
*/
const int ledPin = 13; // the number of the LED pin
const int buttonPin = 2; // the number of the pushbutton pin
@unruthless
unruthless / gist:4253998
Created December 10, 2012 22:40
Fruit + nut stuffing
4 tbsp butter
2 large onion, diced
4 stalks celery, diced
3 cups orange juice
0.5 cups sugar
3 cups cranberries
24 pitted prunes, halved
12 dried apricots, halved
/**
* A handy class to calculate color values.
*
* @version 1.0
* @author Robert Eisele <robert@xarg.org>
* @copyright Copyright (c) 2010, Robert Eisele
* @link http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*
*/
@unruthless
unruthless / gist:3184073
Created July 26, 2012 19:40
Parking Spot calculator logic
var qty_parking_spots,
square_feet,
qty_lubrication_or_service_bay,
qty_day_shift_employees;
// Automobile or machinery sales and service garages
// rule: 1 parking space for each 400 square feet of floor area
parking_spots = floor(square_feet / 400);
@unruthless
unruthless / gist:2416072
Created April 18, 2012 19:49
California municipalities & their URLs
# #############################################################################
# LIBRARIES
import scraperwiki
import urllib
import lxml.html as lh
import mechanize
import re
import simplejson