Skip to content

Instantly share code, notes, and snippets.

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@brendansudol
brendansudol / colorz.js
Created July 14, 2013 17:25
A D3.js recreation of Etsy's shopping by color animation.
var width = 660,
height = 600;
var color = d3.scale.linear()
.domain([0, width/4, width/4 * 2, width/4 * 3, width])
.range(["#fb000f", "#6e00fb", "#00fbec", "#8dfb00", "#fb3c00"])
.interpolate(d3.interpolateHsl);
var svg = d3.select("#colorz").append("svg")
.attr("width", width)
@pkorac
pkorac / leafletGeoJsonTileLayer.js
Last active December 16, 2018 07:43
A really simple GeoJSON tile layer in Leaflet solution The original idea belongs to Koko A. but this is a really simple and minimal piece of code I found if you want to use tiled json layers in leaflet.js Read more about it below (in the script) and be sure that your coordinates are good in the geojson files (i.e. in the right projection).
/*
# GEOJSON TILE LAYER IN LEAFLET.JS
The original idea for this gist comes from Koko A.'s post on leaflet-js google groups
(https://groups.google.com/forum/#!msg/leaflet-js/d7ur-evSz7Q/p_B4ea_0K1AJ)
Use it at your own peril (•
## The basic concept
- setup the map and the tiles as usual
- respond to the "tileload" event with a function that loads the json file (that has the same name - z, x, y - as the tile)
@kelan
kelan / generate_personal_podcast.rb
Created January 22, 2012 23:55
A script for generating a personal podcast feed from mp3 files in a public Dropbox folder.
#!/usr/bin/env ruby -wKU
#
# by Kelan Champagne
# http://yeahrightkeller.com
#
# A script to generate a personal podcast feed, hosted on Dropbox
#
# Inspired by http://hints.macworld.com/article.php?story=20100421153627718
#
# Simply put this, and some .mp3 or .m4a files in a sub-dir under your Dropbox
Options +FollowSymlinks
RewriteEngine on
# No intersticial for direct reference and self-reference
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://box.leebyron.com/.*$ [NC]
# Add a line item for every website you don't need an intersticial for
# I've added my own website, gmail and facebook
RewriteCond %{HTTP_REFERER} !^http(s)?://([^\.]*.)?leebyron.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://mail.google.com/.*$ [NC]