Skip to content

Instantly share code, notes, and snippets.

obsessing over statecharts

Stephen Bussard sbussard

obsessing over statecharts
View GitHub Profile
sbussard / upsshipping.html
Created Aug 26, 2011
Get UPS Shipping Rates
View upsshipping.html
<!DOCTYPE html>
<!-- converted from php -->
<script src=""></script>
<meta charset=utf-8 />
<title>Unofficial UPS Shipping Calculator</title>
sbussard / setup
Created Nov 15, 2011
rackspace + wordpress
View setup
sudo su
apt-get update
apt-get install unzip apache2 php5-mysql libapache2-mod-php5 mysql-server phpmyadmin
# go through the wizards and set up the passwords, making sure to write them down / memorize!
a2enmod rewrite
nano /etc/apache2/sites-enabled/000-default
# change AllowOverride setting for /var/www from None to All, save then quit
sbussard / minivalidator.js
Created Dec 8, 2011
quick email validation
View minivalidator.js
function validate(name, email) {
var errors = [];
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
if(name === '') {
errors.push('You forgot to enter your name');
if(email === '' || !emailReg.test(email)) {
errors.push('Your e-mail address is invalid');
sbussard / gist:2777767
Created May 23, 2012
animated neon thingies
View gist:2777767
Author: Stephen Bussard
Twitter: @sbussard
var sin = Math.sin;
var cos = Math.cos;
var tan = Math.tan;
View .profile
# add this line at the end of the file
python ~/
sbussard / meta.json
Created Jun 13, 2013
if all meta information was stored in a meta file it would be one step closer toward a more semantic web. meta.json could replace all html meta tags, robots.txt, humans.txt, and add the ability to map pages to ontologies through the use of selectors.
View meta.json
// created for
'language': 'en-us',
'charset': 'utf-8',
'author': 'Apple Inc.',
'omni_page': 'How to Contact Us',
'publish-date': 'May 12, 2013',
'sitemap': '',
'shortcut-icon': '',
'viewport': 'width=1024',
sbussard / img2canvas.js
Created Oct 12, 2013
Converts all images on a page to canvas of images
View img2canvas.js
// requires jQuery obviously
$('img').each(function(i, img){
var $img = $(img);
var url = $img.attr('src');
var w = $img.width();
var h = $img.height();
var canvas = $('<canvas data-image="'+i+'"></canvas>').attr({ width: w, height: h });
sbussard / estimator.css
Last active Dec 31, 2015
Cost Estimator App
View estimator.css
* {
box-sizing: border-box;
body {
font-family: sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
#logo {
View confirm
# Add this to ~/.profile or ~/.bashrc or whatever
# ask for a confirmation before executing the following command
confirm() {
read -r -p "Are you sure? [y/N] " response
[[ $response =~ ^([yY][eE][sS]|[yY])$ ]] && $@
export alias c=confirm
sbussard / svg-filter-dropshadow-right.svg
Created Jun 23, 2016
View svg-filter-dropshadow-right.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.