Skip to content

Instantly share code, notes, and snippets.

View dwoodard's full-sized avatar

Dustin Woodard dwoodard

View GitHub Profile
@dwoodard
dwoodard / quicksilver_score.php
Created July 16, 2012 14:22 — forked from kenzie/quicksilver_score.php
Quicksilver string ranking algorithm in PHP
<?
// Quicksilver Score
//
// A port of the Quicksilver string ranking algorithm
// (re-ported from Javascript to PHP by Kenzie Campbell)
// http://route19.com/logbook/view/quicksilver-score-in-php
//
// score("hello world","axl") //=> 0.0
// score("hello world","ow") //=> 0.6
@dwoodard
dwoodard / gist:4348905
Created December 20, 2012 21:57
HTML: starting jquery template
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.3/underscore-min.js"></script>
<title></title>
</head>
<body>
@dwoodard
dwoodard / gist:4348994
Created December 20, 2012 22:10
Javascript: isValidDate()
function isValidDate(value, userFormat) {
// Set default format if format is not provided
userFormat = userFormat || 'mm/dd/yyyy';
// Find custom delimiter by excluding the
// month, day and year characters
var delimiter = /[^mdy]/.exec(userFormat)[0];
// Create an array with month, day and year
@dwoodard
dwoodard / html-bootstrap-cdn
Created February 27, 2013 03:32
html-bootstrap-cdn
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-responsive.min.css" rel="stylesheet">
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
#!/bin/sh
#
# Copyright (c) 2012 NGMOCO
# Updated by Jesse Sanford <jsanford@ngmoco.com>
#
# Portions taken from debian package by
# Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
@dwoodard
dwoodard / gist:8605138
Last active January 4, 2016 09:58
CSS Layout Floats, Position
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block; } body {line-height: 1; } ol, ul {list-style: none; } blockquote, q {quotes: none; } blockquote:before, blockquote:after, q:before, q:after {content: ''; content: none; } table {border-collapse: collapse; border-spacing: 0; }
</s
@dwoodard
dwoodard / gist:9629577
Created March 18, 2014 21:04
html-5-bolierplate
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon(s) in the root directory -->
@dwoodard
dwoodard / gist:2da017dd7c52824de162
Last active August 29, 2015 14:13
Fresh-Win-Install
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install binroot
choco install gnuwin
choco install cmdaliases
choco install nugetpackageexplorer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>