(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.
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| var util = require('util'), | |
| http = require('http'), | |
| events = require('events'); | |
| var Twitter = function(opts) { | |
| this.username = opts.username; | |
| this.password = opts.password; | |
| this.track = opts.track; | |
| this.data = ''; | |
| }; |
| #!/bin/bash | |
| read -s -p "New Password: " password | |
| echo | |
| read -s -p "Re-enter new Password: " confirm | |
| echo | |
| if [ "$password" != "$confirm" ]; then | |
| echo "Password don't match!" | |
| exit 1 | |
| fi |
| function resolveURL(url, base_url) { | |
| var doc = document | |
| , old_base = doc.getElementsByTagName('base')[0] | |
| , old_href = old_base && old_base.href | |
| , doc_head = doc.head || doc.getElementsByTagName('head')[0] | |
| , our_base = old_base || doc_head.appendChild(doc.createElement('base')) | |
| , resolver = doc.createElement('a') | |
| , resolved_url | |
| ; | |
| our_base.href = base_url; |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>Single-Column Responsive Email Template</title> | |
| <style> | |
| @media only screen and (min-device-width: 541px) { | |
| .content { |
| (function () { | |
| var makeCallback = function(eventType, observer) { | |
| if (eventType === 'value') { | |
| return function(snap) { | |
| observer.onNext(snap); | |
| }; | |
| } else { | |
| return function(snap, prevName) { | |
| // Wrap into an object, since we can only pass one argument through. | |
| observer.onNext({snapshot: snap, prevName: prevName}); |
| /** | |
| * STEP 1: Setup | |
| * - Open Chrome Secure Shell settings | |
| * - Open JS Console (CTRL+SHIFT+J) | |
| * - Copy and paste the following: | |
| */ | |
| var s7d_colours = { | |
| 'base03': '#002b36', | |
| 'base02': '#073642', | |
| 'base01': '#586e75', |
(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.
| // how to detect flexbox support | |
| // create a test div in the DOM | |
| var div = document.createElement('div'); | |
| // make sure the default value is display: block | |
| div.style.display = 'block'; | |
| // try some display values invoking flexbox | |
| try { |
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).