Skip to content

Instantly share code, notes, and snippets.

View secobarbital's full-sized avatar

Seggy Umboh secobarbital

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=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')
@ryanmcgrath
ryanmcgrath / twitter_streaming.js
Created February 18, 2011 08:02
Access the Twitter Streaming API with ease (Node.js).
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 = '';
};
@prasmussen
prasmussen / makepasswd.sh
Created June 15, 2012 10:15
Smartos shadow hash generator
#!/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
@johan
johan / resolveURL.js
Created October 19, 2012 00:17
Resolves a relative url against a base_url using browser internals not exposed to you in API form.
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;
@tinabeans
tinabeans / template.html
Last active February 13, 2024 09:18
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!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 {
@gsoltis
gsoltis / rx.firebase.js
Last active May 6, 2024 03:17
Quick Firebase / RxJS binding prototype
(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});
@baldwicc
baldwicc / solarized_setup.js
Last active February 9, 2024 15:38
Solarized Light and Solarized Dark for Chrome Secure Shell (nassh), with fonts
/**
* 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',
@staltz
staltz / introrx.md
Last active June 15, 2024 12:24
The introduction to Reactive Programming you've been missing
@BracketBulldog
BracketBulldog / detect-flexbox-and-flexwrap-support
Created January 10, 2015 21:58
How to detect browser support for flexbox and flexwrap
// 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.

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).