Skip to content

Instantly share code, notes, and snippets.

View lynsei's full-sized avatar
:octocat:
Huzzah!

Lynsei lynsei

:octocat:
Huzzah!
View GitHub Profile
@mbostock
mbostock / .block
Last active November 24, 2020 15:48
Raster & Vector IV
license: gpl-3.0
redirect: https://observablehq.com/@d3/zoomable-raster-vector
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Custom tasks
require 'capistrano/composer'
require 'capistrano/npm'
@jelbourn
jelbourn / api-provider.js
Last active February 25, 2024 12:51
Example of using an angular provider to build an api service. Subject of August 20th 2013 talk at the NYC AngularJS Meetup. http://www.meetup.com/AngularJS-NYC/events/134578452/See in jsbin: http://jsbin.com/iWUlANe/5/editSlides: https://docs.google.com/presentation/d/1RMbddKB7warqbPOlluC7kP0y16kbWqGzcAAP6TYchdw
/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn (@jelbourn)
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/
@twasink
twasink / AssociativeReader.js
Created April 16, 2013 00:33
ExtJS has some really nice support out of the box for converting JSON data to model objects. However, it only supports array-based associations, and doesn't support maps/associative arrays. The AssociativeReader - included here, along with two demo models and sample data - provides a way to do that.
/**
* A variant of the JSON reader. Instead of reading arrays, where each record in the array field
* has an 'id' property, it reads objects - aka associative arrays. The key of the entry will be the
* array.
*
* So where the JSON reader would like data like this:
* [ { id: '1', property: 'foo' }, { id: '2', property: 'bar' } ]
*
* the associative reader likes data like this:
* { '1': { property: 'foo' }, '2': { property: 'bar' } }