Skip to content

Instantly share code, notes, and snippets.

View sivartravis's full-sized avatar

Travis Taylor sivartravis

  • Cambridge, MA
View GitHub Profile
@sivartravis
sivartravis / css_resources.md
Created March 2, 2014 22:30 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@sivartravis
sivartravis / javascript_resources.md
Created March 2, 2014 22:30 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@sivartravis
sivartravis / 0_reuse_code.js
Created March 2, 2014 22:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#should have known R already has horizon plot functionality
#latticeExtra (already a favorite package of mine) has it sitting right there
#http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=latticeExtra:horizonplot
require(lattice)
require(latticeExtra)
require(reshape2)
require(quantmod)
@sivartravis
sivartravis / horizon plot.r
Created February 25, 2016 21:04 — forked from timelyportfolio/horizon plot.r
R Horizon Chart
require(lattice)
require(latticeExtra)
require(reshape2)
require(quantmod)
#set up horizon plots as a function
horizonplot <- function(prices,horizon.type="offset",scale=0.05,title=NA,alpha=0.4){
#get change in prices since beginning or 1st row
prices.change <- prices[,4]/as.numeric(prices[1,4])-1
#get as a data.frame so it will work well with melt and lattice
@sivartravis
sivartravis / animate.R
Created February 25, 2016 21:08 — forked from thomasp85/animate.R
Animating graph over time
library(ggraph)
library(gganimate)
library(igraph)
# Data from http://konect.uni-koblenz.de/networks/sociopatterns-infectious
infect <- read.table('out.sociopatterns-infectious', skip = 2, sep = ' ', stringsAsFactors = FALSE)
infect$V3 <- NULL
names(infect) <- c('from', 'to', 'time')
infect$timebins <- as.numeric(cut(infect$time, breaks = 100))
# We want that nice fading effect so we need to add extra data for the trailing
@sivartravis
sivartravis / README.md
Created February 25, 2016 21:09 — forked from eesur/README.md
d3 | reusable slopegraph v2

Updated reusable slopegraph sketch, from my previous slopegraph version

This version allows for multiple sets/columns and will adapted accordingly. Added some interaction to toggle the sets/columns and also toggle highlighted line.

data source

@sivartravis
sivartravis / README.md
Created February 25, 2016 21:10 — forked from curran/README.md
Lynchings by State Donut Charts
@sivartravis
sivartravis / README.md
Created February 25, 2016 21:11 — forked from curran/README.md
Stacked Bars
@sivartravis
sivartravis / d3.layout.timeline.js
Created February 25, 2016 21:12 — forked from emeeks/d3.layout.timeline.js
Radial Timeline
(function() {
d3.layout.timeline = function() {
var timelines = [];
var dateAccessor = function (d) {return new Date(d)};
var processedTimelines = [];
var startAccessor = function (d) {return d.start};
var endAccessor = function (d) {return d.end};
var size = [500,100];
var timelineExtent = [-Infinity, Infinity];
var setExtent = [];