Skip to content

Instantly share code, notes, and snippets.

View tomhodgins's full-sized avatar
😍
Writing CSS

Tommy Hodgins tomhodgins

😍
Writing CSS
View GitHub Profile
@tomhodgins
tomhodgins / realestatemogul.js
Created July 7, 2015 02:30
RealEstateMogul ascii art
console.log(' ___ ___ _ _ ___ ___ _____ _ _____ ___ lll\n| _ \\ __| /_\\ | | | __/ __|_ _/_\\_ _| __| l::l\n| / _| / _ \\| |__ | _|\\__ \\ | |/ _ \\| | | _| l:::l\n|_|_\\___/_/ \\_\\____| |___|___/ |_/_/ \\_\\_| |___| l::::l\n mmmmmmmmm mmmmmmm ooooooooooo gggggggggggggggguuuuuu uuuuuul::::l\nmm::::::::m m:::::::mm oo:::::::::::oo g:::::::::::::::gu::::u u::::ul::::l\nm::::::::::mm::::::::::mo:::::::::::::::o g::::::::::::::::gu::::u u::::ul::::l\nm::::::::::::::::::::::mo:::::ooooo:::::og::::::ggggg::::::gu::::u u::::ul::::l\nm:::::mmm::::::mmm:::::mo::::o o::::og:::::g g:::::gu::::u u::::ul::::l\nm::::m m::::m m::::mo::::o o::::og:::::g g:::::gu::::u u::::ul::::l\nm::::m m::::m m::::mo::::o o::::og:::::g g:::::gu::::u u::::ul::::l\nm::::m m::::m m::::mo::::o o::::og::::::g g:::::gu:::::uuuu:::::
@tomhodgins
tomhodgins / plugin-options.html
Last active August 29, 2015 14:24
Experiment in supplying options to a function using an object as one argument instead of individual arguments. This pattern will come in handy building plugins (e.g. adding a headline and content to a modal)
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<title>Supplying Option Overrides to Functions for Building Plugins</title>
</head>
<body>
<script>
function test(options) {
data = {
@tomhodgins
tomhodgins / fuzzyCountdown.js
Last active August 29, 2015 14:26
Fuzzy Countdown is a Javacript countdown plugin that uses random intervals of time. Demo and documentation at http://staticresource.com/count.html
// Fuzzy Countdown is a countdown plugin that uses random intervals of time
// Author: Tommy Hodgins (tomhodgins@gmail.com)
// Usage: This will run on any element on the page that includes the `data-countdown` attribute
// Options: use the following attributes to override the default settings:
// `data-start` is the initial value of the countdown
// `data-stop` is the final value that will be displayed when counting stops
// `data-time-min` is the minimum time interval, described in milliseconds (1000ms = 1s)
// `data-time-max` is the maximum time interval, described in milliseconds (1000ms = 1s)
// Note: To count in non-random intervals, make `data-time-min` and `data-time-max` equal
@tomhodgins
tomhodgins / reminders.html
Last active September 7, 2015 04:10
Reminders is a lightweight single-page application written in HTML, CSS, and JavaScript. It stores and loads the reminders from localStorage in the browser you created them. http://staticresource.com/reminders.html
<!DOCTYPE html>
<html manifest="reminders.manifest">
<head>
<title>Reminders</title>
<meta charset=utf-8>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, minimal-ui">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
<script>eval(unescape(escape('♶♡♲☠♩☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♣♡♮♶♡♳☧☩☬♣☽♩☮♧♥♴♃♯♮♴♥♸♴☨☧☲♤☧☩☬♦☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♬♩♮♫☧☩☬♭☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♬♩♮♫☧☩☻♩☮♷♩♤♴♨☽☲☰☰☻♩☮♨♥♩♧♨♴☽☲☰☰☻♣☮♦♩♬♬♓♴♹♬♥☽☧☣♦♣☰☧☻♣☮♢♥♧♩♮♐♡♴♨☨☩☻♣☮♭♯♶♥♔♯☨☱☰☬☰☩☻♣☮♬♩♮♥♔♯☨☱☹☰☬☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☲☰☰☬☰☬☲☰☰☬☱☰☩☻♣☮♬♩♮♥♔♯☨☲☰☰☬☱☹☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☲☰☰☬☲☰☰☬☱☹☰☬☲☰☰☩☻♣☮♬♩♮♥♔♯☨☱☰☬☲☰☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☰☬☲☰☰☬☰☬☱☹☰☩☻♣☮♬♩♮♥♔♯☨☰☬☱☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☰☬☰☬☱☰☬☰☩☻♣☮♣♬♯♳♥♐♡♴♨☨☩☻♣☮♦♩♬♬☨☩☻♣☮♳♴♲♯♫♥♓♴♹♬♥☽☧☣♥☹☰☧☻♣☮♬♩♮♥♗♩♤♴♨☽☧☱☰☧☻♣☮♢♥♧♩♮♐♡♴♨☨☩☻
@tomhodgins
tomhodgins / validation.html
Last active September 17, 2015 01:39
Validation — Simple input filtering and validation with error messages in pure JavaScript. Demo at http://staticresource.com/validation.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, minimal-ui">
<title>Form Validation</title>
<style>
* { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: auto; font-family: 'Open Sans', 'Source Sans Pro', Roboto, 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', 'Myriad Pro', 'Segoe UI', Myriad, Helvetica, 'Lucida Grande', 'DejaVu Sans Condensed', 'Liberation Sans', 'Nimbus Sans L', Tahoma, Geneva, Arial, sans-serif; line-height: 1.2;}
input { display:block; width: 100%; margin: 10px 0; padding: 8px 10px; appearance: none; border: 1px solid #ccc; border-radius: 2px; font-size: 14pt;}
[data-status=error] { border-color:red; }
@tomhodgins
tomhodgins / conjure.html
Last active September 17, 2015 01:40
Conjure — Lightweight HTML Templating for Dropdowns, Tooltips, Popovers, Toggles, and Modals. Demo at http://staticresource.com/conjure.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Conjure</title>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, minimal-ui">
<style type="text/css">
* { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: auto; font-family: 'Open Sans', 'Source Sans Pro', Roboto, 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', 'Myriad Pro', 'Segoe UI', Myriad, Helvetica, 'Lucida Grande', 'DejaVu Sans Condensed', 'Liberation Sans', 'Nimbus Sans L', Tahoma, Geneva, Arial, sans-serif;}
button { display: block; width: auto; }
/* Modals */
@tomhodgins
tomhodgins / chrominator.sh
Created August 3, 2011 21:14
Update Chromium to latest nightly build for OS X
#! /bin/sh
echo "Downloading the latest Chromium build"
echo "Preparing a temporary working area"
mkdir ~/Downloads/chrominator
cd ~/Downloads/chrominator
echo "Fetching the latest Chromium build"
MY_VAR="$(curl http://build.chromium.org/f/chromium/snapshots/Mac/LATEST)"
@tomhodgins
tomhodgins / webkitten.sh
Created August 6, 2011 09:21
Update WebKit to latest nightly build for OS X
#! /bin/sh
echo "Welcome to WebKitten, the WebKit updater"
echo "This process may take a few minutes"
mkdir ~/.webkitten
cd ~/.webkitten
# This sets a variable named 'LATEST' that is the
# value of the latest webkit download for OS X
LATEST=`curl -s "http://nightly.webkit.org" | sed -n 's/.*http/http/'p | sed -n 's/dmg.*/dmg/'p | sed -n 1p`
@tomhodgins
tomhodgins / firefetch.sh
Created August 17, 2011 21:18
Update Firefox to latest nightly build for OS X
#! /bin/sh
echo "Welcome to FireFetch, the Firefox updater"
echo "This process may take a few minutes"
mkdir ~/.firefetch
cd ~/.firefetch
# This sets a variable named 'LATEST' that is the
# value of the latest Firefox download for OS X
LATEST=`curl -s "http://nightly.mozilla.org" | sed -n 's/.*http/http/'p | sed -n 's/dmg.*/dmg/'p | sed -n 1p`
@tomhodgins
tomhodgins / serverbackup.sh
Created June 19, 2012 14:56
Site and SQL backup for MediaTemple servers
#!/bin/sh
#####################################################################
## ##
## Welcome to the server backup script, before backing up your ##
## files be sure to update your SQL username and password below ##
## ##
## This script assumes you have folders 'server' and 'databases' ##
## already created inside your /root/backup/ folder ##
## ##