Skip to content

Instantly share code, notes, and snippets.

View stefbowerman's full-sized avatar

Stefan Bowerman stefbowerman

View GitHub Profile
@stefbowerman
stefbowerman / CLI_BS.bash
Last active October 19, 2015 22:57
Assorted bash commands to get me through life
# Copy a file from local host to remote host
##################################################
scp -i ~/.ssh/{key}.pem {local_file} {username}@{host}:{directory_path}
# i.e. scp -i ~/.ssh/elder-aws.pem ./my_file.php ubuntu@ec2-52-27-158-192.us-west-2.compute.amazonaws.com:/var/www/html/directory
# Copy a file from a remote host to local host
##################################################
@stefbowerman
stefbowerman / Chalkboard.scss
Created August 22, 2014 02:29
Make a chalkboard with html!
/*
*
* To build a chalkboard, use the following HTML structure
*
* <div class="chalkboard-frame">
* <div class="chalkboard">
* <div class="chalkboard-interior">
* <div class="chalkboard-content">
* <!-- Enter your content here -->
* </div>
@stefbowerman
stefbowerman / Violations-2012.csv
Created July 18, 2014 20:57
Code For America 2015 Interview question. Take the provided CSV, use your preferred language to parse it and display the data. Requested information was 1) the number of violations in each category, 2) the earliest violation date for each category and 3) the latest violation date for each category. jQuery is listed as a dependency but only for p…
violation_id inspection_id violation_category violation_date violation_date_closed violation_type
204851 261019 Garbage and Refuse 2012-01-03 00:00:00 2012-02-02 00:00:00 Refuse Accumulation
204852 261019 Unsanitary Conditions 2012-01-03 00:00:00 2012-02-02 00:00:00 Unsanitary conditions, not specified
204853 261023 Garbage and Refuse 2012-01-03 00:00:00 2012-01-17 00:00:00 Refuse Accumulation
204854 261023 Garbage and Refuse 2012-01-03 00:00:00 2012-01-17 00:00:00 Refuse Accumulation
204858 261029 Garbage and Refuse 2012-01-03 00:00:00 2012-03-12 00:00:00 Refuse Accumulation
204859 261029 Animals and Pests 2012-01-03 00:00:00 2012-03-12 00:00:00 Animals and Pests, not specified
207746 264687 Animals and Pests 2012-02-08 00:00:00 2012-04-02 00:00:00 Animals and Pests, not specified
205869 262387 Garbage and Refuse 2012-01-13 00:00:00 2012-01-17 00:00:00 Refuse Accumulation
207417 264347 Garbage and Refuse 2012-01-11 00:00:00 2012-01-13 00:00:00 Refuse Accumulation
@stefbowerman
stefbowerman / TickingClock.coffee
Last active August 29, 2015 14:03
Simple Coffeescript Clock
class Clock
constructor: (targetEl) ->
@$targetEl = $(targetEl)
@tickingInterval = null
startTicking: ->
@tick()
@tickingInterval = setInterval( =>
@tick()
@stefbowerman
stefbowerman / ShoppingCart.coffee
Created July 7, 2014 22:15
Simple shopping cart class written in coffeescript
# Items have the following properties : ID (string), size (string), sizeDisplay (string), price (int)
class ShoppingCart
constructor: (@shipping = 5) ->
@items = []
_listItems: -> @items
addItem: (item) ->
width = 200
height = 200
area = width * height
container = document.getElementById 'container'
canvas = document.createElement 'canvas'
canvas.width = width
canvas.height = height
canvas.style.display = 'block'
@stefbowerman
stefbowerman / gist:9130315
Created February 21, 2014 07:45
Text effect. Makes text look like ink splashed with water.
.fuzz-text {
color: #333;
color: rgba(0, 0, 0, 0.6);
text-shadow: 0 0 1px #797979;
}
@stefbowerman
stefbowerman / candy-stripe.scss
Last active August 29, 2015 13:56
Candy stripe text shadow. Looks cool if the font color is the same as the background color.
$color1: #FFF;
$color2: #F00; // Red
.candy-stripe {
color: $color1;
text-shadow:
1px 1px 1px $color2,
2px 2px 1px $color1,
3px 3px 1px $color2,
4px 4px 1px $color1;
@stefbowerman
stefbowerman / cursorTrail.js
Created January 29, 2014 18:59
MySpace Cursor Trail. Used originally to trail a balloon looking cursor with 3 different sized bubble images.
function randomFromInterval(from,to)
{
return Math.floor(Math.random()*(to-from+1)+from);
}
function cursorTrail(e){
var i = randomFromInterval(1, 3),
fadeOutTime = randomFromInterval(100, 200),
top = e.pageY - randomFromInterval(15, 20),
left = e.pageX- randomFromInterval(15, 20),
@stefbowerman
stefbowerman / myPlaySubscribe.php
Last active January 4, 2016 20:29
MyPlay Mailing List Subscribe
<?php
$url = "https://subs.myplay.com/app/ly/signup";
$fields = array(
'email' => urlencode('user@email.com'),
'country' => urlencode('US'),
'list' => urlencode('ln_musicbox_newsletter'),
'lists_on_form' => urlencode('ln_musicvox_newsletter'),
'confirm' => urlencode('Y'),