Guiding frameworks
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.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
extension Array { | |
func first() -> Element? { | |
if isEmpty { | |
return nil | |
} | |
return self[0] | |
} | |
func last() -> Element? { |
@holman got a request about our deployment system, heaven
I know it's not a high priority, but has there been any activity on open-sourcing the core Heaven gem?
There is. I've been working on extracting the non-GitHub specific parts into two gems. This first is a CLI portion called hades. The second is an HTTP API portion called heaven.
When you open source something previously used as in internal tool like Heaven, Hubot, Boxen, etc., how do you manage and hook in the parts that need to stay internal?
Normally I focus around four questions:
I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).
In Vim I have key bindings C-h/j/k/l
set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W
.) I'd like to use the same keystrokes for switching tmux panes.
An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\
.
Here's how it should work:
I'm going to be deprecating the current Readernaut API in favor of a newer more built-out version. People using the current version have two weeks to switch over to the new API. Currently you can find your API_KEY by viewing source on any page and searching for "api_key" in the output (this will get better later). Here are some example endpoints:
- Old:
/services/api/USERNAME/notes/
- New:
/api/v1/notes/note/?username=YOUR_USERNAME&api_key=YOUR_API_KEY&user__username=USERNAME
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 1 MB sequentially from memory 250,000 ns 0.25 ms | |
Round trip within same datacenter 500,000 ns 0.5 ms | |
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory |
#!/bin/sh | |
# This shows how to handle combined short options along with | |
# other long and short options. It does so by splitting them | |
# apart (e.g. 'tar -xvzf ...' -> 'tar -x -v -z -f ...') | |
while test $# -gt 0 | |
do | |
case $1 in |
// Use @include colorize('image.png', red, 0.5) | |
@mixin colorize($image, $color, $opacity) { | |
background: $color; | |
$color: transparentize($color, 1 - $opacity); | |
background: -webkit-linear-gradient(left, $color, $color), url($image); | |
background: -moz-linear-gradient(left, $color, $color), url($image); | |
background: -ms-linear-gradient(left, $color, $color), url($image); | |
background: -o-linear-gradient(left, $color, $color), url($image); | |
} |
#!/usr/bin/env ruby -w | |
# brew-services(1) - Easily start and stop formulas via launchctl | |
# =============================================================== | |
# | |
# ## SYNOPSIS | |
# | |
# [<sudo>] `brew services` `list`<br> | |
# [<sudo>] `brew services` `restart` <formula><br> | |
# [<sudo>] `brew services` `start` <formula> [<plist>]<br> |