Skip to content

Instantly share code, notes, and snippets.

View kylebradshaw's full-sized avatar
🍌

Kyle Bradshaw kylebradshaw

🍌
View GitHub Profile
@kylebradshaw
kylebradshaw / responsinator-bookmarklet
Created March 15, 2012 14:53
The Responsinator Bookmarklet
javascript:void(function(){window.location='http://responsinator.com/%3Furl='+encodeURIComponent(window.location.href);})();
@kylebradshaw
kylebradshaw / getFiletype
Created August 31, 2012 18:39
capture the filetype from a url string (good for getting the filetype from a collection of hrefs)
var getFiletype = function(string){
var lastPeriod = string.lastIndexOf('.') + 1, //char after .
length = string.length,
diff = length - lastPeriod;
if (lastPeriod > 0 && diff <=5) {
return string.substring(lastPeriod,length);
}
};
var filetype = getFiletype(url);
@kylebradshaw
kylebradshaw / serve-heroku-issue
Created November 3, 2012 13:05
serve error on heroku deploy bound to port 4000
2012-11-03T12:54:47+00:00 heroku[slugc]: Slug compilation started
2012-11-03T12:55:00+00:00 heroku[slugc]: Slug compilation finished
^[[1;9C2012-11-03T12:55:51+00:00 heroku[web.1]: Unidling
2012-11-03T12:55:51+00:00 heroku[web.1]: State changed from down to starting
2012-11-03T12:55:52+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 17663`
2012-11-03T12:55:54+00:00 app[web.1]: DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from require at /app/config.ru:14)
2012-11-03T12:55:54+00:00 app[web.1]: [2012-11-03 12:55:54] INFO WEBrick 1.3.1
2012-11-03T12:55:54+00:00 app[web.1]: [2012-11-03 12:55:54] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2012-11-03T12:55:54+00:00 app[web.1]: [2012-11-03 12:55:54] INFO WEBrick::HTTPServer#start: pid=2 port=4000
2012-11-03T12:55:54+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 4000, should be 17663 (see environment
@kylebradshaw
kylebradshaw / Yeoman upgrade installation
Created November 3, 2012 21:47
Yeoman Installation issues
An upgrade failed, now upon trying to reinstall yeoman
npm install -g yeoman
I get to a point in the installation where it fails on the lookup of the packages.
npm ERR! fetch failed http://nodeload.github.com/yeoman/generators/tarball/3d709c61cd
npm ERR! fetch failed http://nodeload.github.com/gruntjs/grunt/tarball/0ba6d4b529
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/mkdirp
@kylebradshaw
kylebradshaw / gist:4497090
Created January 9, 2013 21:24
Responsive utilities on mass.gov Includes responsive tables, responsive slideshow & responsive google maps
// 01092013 KB
var MAGOV = window.MAGOV = window.MAGOV || {}; //namespace custom scripts
jQuery(document).ready(function ($) {
"use strict";
//fitVids plugin for YT, iframe embeds
$(".container").fitVids();

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@kylebradshaw
kylebradshaw / .gitconfig
Created November 16, 2014 00:48
gitconfig
[core]
editor = subl
autocrlf = input
safecrlf = true
[color]
diff = auto
status = auto
branch = auto
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@kylebradshaw
kylebradshaw / README.md
Last active August 29, 2015 14:22 — forked from kerryrodden/.block

This example shows how it is possible to use a D3 sunburst visualization (partition layout) with data that describes sequences of events.

A good use case is to summarize navigation paths through a web site, as in the sample synthetic data file (visit_sequences.csv). The visualization makes it easy to understand visits that start directly on a product page (e.g. after landing there from a search engine), compared to visits where users arrive on the site's home page and navigate from there. Where a funnel lets you understand a single pre-selected path, this allows you to see all possible paths.

Features:

  • works with data that is in a CSV format (you don't need to pre-generate a hierarchical JSON file, unless your data file is very large)
  • interactive breadcrumb trail helps to emphasize the sequence, so that it is easy for a first-time user to understand what they are seeing
  • percentages are shown explicitly, to help overcome the distortion of the data that occurs wh