(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
[RoutePrefix("files")] | |
public class FilesController : ApiController | |
{ | |
[GET("somepdf/{id}")] | |
public HttpResponseMessage GetSomePdf(string id) | |
{ | |
var path = MyApp.PathToSomePdf(id); | |
if (path!= null) | |
return FileAsAttachment(path, "somepdf.pdf"); |
// assumes you add a timestamp field to each record (see Firebase.ServerValue.TIMESTAMP) | |
// pros: fast and done server-side (less bandwidth, faster response), simple | |
// cons: a few bytes on each record for the timestamp | |
var ref = new Firebase(...); | |
ref.orderByChild('timestamp').startAt(Date.now()).on('child_added', function(snapshot) { | |
console.log('new record', snap.key()); | |
}); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/** | |
* @jsx React.DOM | |
*/ | |
var React = require('react'), | |
MyReactComponent = React.createClass({ | |
// The object returned by this method sets the initial value of this.state | |
getInitialState: function(){ | |
return {}; |
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).
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
/** | |
* @jsx React.DOM | |
*/ | |
var React = require('react'), | |
MyReactComponent = React.createClass({ | |
// The object returned by this method sets the initial value of this.state | |
getInitialState: function(){ | |
return {}; |
; Simple Division Calculator | |
; Kurt Kaiser | |
INCLUDE Irvine32.inc | |
; .data is used for declaring and defining variables | |
.data | |
codeTitle BYTE " --------- Math Magic --------- ", 0 | |
directions BYTE "Enter 2 numbers.", 0 | |
prompt1 BYTE "First number: ", 0 |