Skip to content

Instantly share code, notes, and snippets.

Avatar
♻️
obsessing over statecharts

Stephen Bussard sbussard

♻️
obsessing over statecharts
View GitHub Profile
@sbussard
sbussard / upsshipping.html
Created Aug 26, 2011
Get UPS Shipping Rates
View upsshipping.html
<!DOCTYPE html>
<!-- converted from php http://www.geekpedia.com/tutorial213_Creating-a-UPS-Shipping-Calculator.html -->
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Unofficial UPS Shipping Calculator</title>
</head>
@sbussard
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
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
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 ~/.psam.py
@sbussard
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 apple.com/contact
"{
'language': 'en-us',
'charset': 'utf-8',
'author': 'Apple Inc.',
'omni_page': 'How to Contact Us',
'publish-date': 'May 12, 2013',
'sitemap': 'http://www.apple.com/sitemap',
'shortcut-icon': 'http://www.apple.com/favicon.ico',
'viewport': 'width=1024',
@sbussard
sbussard / img2canvas.js
Created Oct 12, 2013
Converts all images on a page to canvas of images
View img2canvas.js
// requires jQuery obviously
$(function(){
$('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 });
$(img).replaceWith(canvas);
@sbussard
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
sbussard / svg-filter-dropshadow-right.svg
Created Jun 23, 2016
svg-filter-dropshadow-right.svg
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.