Skip to content

Instantly share code, notes, and snippets.

View stephenhandley's full-sized avatar
🎾
let

Stephen Handley stephenhandley

🎾
let
View GitHub Profile
@stephenhandley
stephenhandley / output.txt
Created January 24, 2016 03:04
try catch expression value coffeescript
ok: wow
nok: [Error: honkytonk]
@stephenhandley
stephenhandley / exportQueue.js
Last active April 26, 2024 10:46
Rdio queue to json
var queue = [];
var $albums = $('.QueueList .Album');
for (var i = 0; i < $albums.length; i++) {
var $album = $($albums[i]);
var $title = $album.find('.album_title');
var $artist = $album.find('.artist_title');
queue.push({
title : $title.text(),
href : $title.attr('href'),
artist : $artist.text()
@stephenhandley
stephenhandley / FrequentWordsWithMismatches.pseudocode
Created August 10, 2015 02:33
Potential bug with FrequentWordsWithMismatches pseudocode in "Finding Hidden Messages in DNA" book
FrequentWordsWithMismatches(Text, k, d)
FrequentPatterns ← an empty set
Neighborhoods ← an empty list
for i ← 0 to |Text| − k
add Neighbors(Text(i, k), d) to Neighborhoods
form an array NeighborhoodArray holding all strings in Neighborhoods
for i ← 0 to |Neighborhoods| − 1
Pattern ← NeighborhoodArray(i)
Index(i) ← PatternToNumber(Pattern)
Count(i) ← 1
@stephenhandley
stephenhandley / gist:fabab41a57dbe5d701ee
Created February 15, 2015 01:07
instagram embed thing for jeff to use
<html>
<head>
<script src="http://platform.instagram.com/en_US/embeds.js"></script>
</head>
<body style="background-color: black">
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="4" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nq
@stephenhandley
stephenhandley / output.txt
Last active August 29, 2015 14:12
Compatriots! Soda in the drinking fountains is 100% true!
Harry Reid:FAAAAAAAAAART! *points finger at Republicans*
Ted Cruz:FAAAAAAAAAAAAAAAAAAAART! *points finger at Democrats*
Elizabeth Warren:FAAART! *points finger at Republicans*
Jebster:FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAART! *points finger at Democrats*
Compatriots! I AM DEFINITIELY NOT LYING WHEN I SAY Soda in the drinking fountains is 100% true!
XOXO Harry Reid
Countrymen! I AM DEFINITIELY NOT LYING WHEN I SAY Soda in the drinking fountains is 100% true!
@stephenhandley
stephenhandley / AND_ALL_OF_THESE_APPROACHES_R_LAME.coffee
Created November 29, 2014 04:33
finding object in array of objects by property value
BARFS = [
{
x : 10
name : 'pizza'
}
{
x : 11
name : 'tacos'
}
{
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<style>
body {
font-family : 'Lato', sans-serif;
font-size : 100px;
padding-left : 40px;
}
.thin { font-weight : 100; }
Verifying that +stephenhandley is my openname (Bitcoin username). https://onename.io/stephenhandley
Fs = require('fs')
Path = require('path')
ChildProcess = require('child_process')
TYPES = {
"PNG image data" : 'png'
"JPEG image data" : 'jpg'
"GIF image data" : 'gif'
"TIFF image data" : 'tiff'
@stephenhandley
stephenhandley / substanceware
Created December 11, 2013 06:06
substanceware
/*
* ----------------------------------------------------------------------------
* "THE {$substance}WARE LICENSE" (Revision 69):
* {$author}<{$email}> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy {$author} ${substance} in return.
* ----------------------------------------------------------------------------
*/