Skip to content

Instantly share code, notes, and snippets.

♻️
obsessing over statecharts

Stephen Bussard sbussard

♻️
obsessing over statecharts
Block or report user

Report or block sbussard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 / .profile
Last active Aug 29, 2015
Stable, fast and awesome looking PS1
View .profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
promptFunc() {
COOL_COLOR="\[\e[38;5;25m\]"
REPO_FORMAT="\[\e[48;5;233m\]"
DIM="\[\e[2m\]"
@sbussard
sbussard / tnsenate.geojson
Created Jan 26, 2015
TN Senate Disctricts
View tnsenate.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View tntraffic.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View designer.html
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../core-menu-button/core-menu-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<polymer-element name="my-element">
<template>
@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 {
@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 / 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',
View .profile
# add this line at the end of the file
python ~/.psam.py
@sbussard
sbussard / EnergyBalls.js
Created Jun 16, 2012
EnergyBalls – animated "energy balls" floating in "space"
View EnergyBalls.js
/*
Author: Stephen Bussard
Twitter: @sbussard
*/
var sin = Math.sin,
cos = Math.cos,
tan = Math.tan,
You can’t perform that action at this time.