Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE HTML>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HTML Swatches</title>
<style>
body
{
margin: 1em;

Keybase proof

I hereby claim:

  • I am kihlstrom on github.
  • I am kihlstrom (https://keybase.io/kihlstrom) on keybase.
  • I have a public key whose fingerprint is C2F8 4BEA 47D7 103E F4E2 FCA4 C7EB 64B4 B60A 5890

To claim this, I am signing this object:

// jQuery.naturalWidth / jQuery.naturalHeight plugin for (already-loaded) images
// Triple-licensed: Public Domain, MIT and WTFPL license - share and enjoy!
(function($) {
function img(url) {
var i = new Image;
i.src = url;
return i;
}
@kihlstrom
kihlstrom / WastedEarlyMorning.tmTheme
Last active December 12, 2015 02:48
A color scheme for Sublime Text (including matching brackets using the BracketHighlighter plugin).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>WastedEarlyMorning</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@kihlstrom
kihlstrom / responsive-font-sizing.js
Last active October 11, 2015 18:58
JavaScript that creates CSS media queries for responsive font sizing
function responsiveFontSizing( config ) {
var mediaQueryType = ( config && config.mediaQueryType ) || 'min-width';
var widthBegin = ( config && config.widthBegin && parseFloat( config.widthBegin, 10 ) ) || 17;
var widthEnd = ( config && config.widthEnd && parseFloat( config.widthEnd, 10 ) ) || 34;
var fontSizeBegin = ( config && config.fontSizeBegin && parseFloat( config.fontSizeBegin, 10 ) ) || 2;
var fontSizeEnd = ( config && config.fontSizeEnd && parseFloat( config.fontSizeEnd, 10 ) ) || 4;
var lineHeightBegin = ( config && config.lineHeightBegin && parseFloat( config.lineHeightBegin, 10 ) ) || 1.25;
var lineHeightEnd = ( config && config.lineHeightEnd && parseFloat( config.lineHeightEnd, 10 ) ) || 1.0625;
var selector = ( config && config.selector ) || 'h1';
var unit = ( config && config.unit ) || 'em';
@kihlstrom
kihlstrom / close_tag_on_slash.py
Created August 9, 2011 13:04
Close Tag On Slash Command for Sublime Text 2
import sublime, sublime_plugin
class CloseTagOnSlashCommand( sublime_plugin.TextCommand ) :
def run( self, edit ) :
self.view.insert( edit, self.view.sel()[0].begin(), '/' )
whatIsLeft = self.view.substr( sublime.Region( 0, self.view.sel()[0].begin() ) )
if whatIsLeft[-2] == '<' :
tag = ''
while len( tag ) == 0 and len( whatIsLeft ) > 0 :
closeStart = whatIsLeft.rfind( '</' )