Skip to content

Instantly share code, notes, and snippets.

View iros's full-sized avatar

Irene Ros iros

View GitHub Profile
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@iros
iros / force.reqanimframe.js
Created April 15, 2016 19:49
force layout with d3.timer instead of tick loop
var force = d3.layout.force()
.charge(-150)
.linkDistance(30)
.size([width, height]);
d3.json("assets/500nodes.json", function(error, graph) {
if (error) throw error;
// Task 2:
// Connect the force layout to the nodes and links in our dataset
@iros
iros / application.js
Created November 12, 2011 17:34
BackboneTraining-require.js
// Define whatever global space vars you might need.
var mbta = {
// application configuration parameters
app : {
server : "http://backbonetraining.bocoup.com:8000"
},
// application data
data : {
// station collection
lines : null
@iros
iros / css_pattern_use.html
Last active March 15, 2022 11:33
patternfill_gists
<div class="circles-1">
</div>
@iros
iros / Dockerfile
Created October 5, 2017 15:41
Travis dockerfile
FROM openjdk:8
RUN wget http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
RUN tar zxvf apache-maven-3.3.9-bin.tar.gz
RUN chmod +x apache-maven-3.3.9/bin/mvn
RUN export M2_HOME=$PWD/apache-maven-3.3.9
RUN export PATH=$PWD/apache-maven-3.3.9/bin:${PATH}
RUN apt-get update
RUN apt-get install -y software-properties-common
license: mit
@iros
iros / .block
Last active August 17, 2017 18:52
D3 v3 - circle re-packing stability
license: mit
@iros
iros / .block
Last active August 17, 2017 18:52
D3 v4 - circle re-packing stability
license: mit
@iros
iros / backbone.sync.js
Last active May 17, 2017 22:28
Backbone.sync override to use in memory storage with deferred support
Backbone.sync = function(method, model, options) {
// we need to make sure we initialize a store, in this case
// we will just use a JS object.
var cache = {};
// The size will be primarily used to assign ids to newly
// created models. Each time a new model is created, the size
// will be incremented.
var size = 0;
@iros
iros / timefill.R
Created June 4, 2012 19:35
Padding a Time Series in R
# Read a comma-delimited file that has the following content
# time,observations
# 2011/11/01,12
# 2012/01/01,320
# 2011/12/01,100
# 2012/06/01,7
raw.data <- read.delim("timefill.csv", header=T, sep=",")
# Convert the time column to a date column.
# Accessing a column is done by using the '$' sign