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

/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@hubert3
hubert3 / samsung_hash_crack.py
Last active November 22, 2022 09:12
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
#!/usr/bin/python
'''
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
Correct PIN for hash and salt below is 1234.
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db
@briandoll
briandoll / A_toast_to_you.md
Last active March 19, 2022 01:17
Toasts! - scripts to convert images attached to GitHub issues into an animated gif for serious celebratory purposes

To toast:

  • Make sure you have ImageMagick installed (brew install imagemagick)
  • Change line 7 of toast.rb to the repository name you're working with
  • toast!
$ bundle install
$ ./get_token [user] [pass]
$ export GHUSER=[myuser]
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
Ruby 2.1.0 in Production: known bugs and patches
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production.
While testing the new build for rollout, we ran into a number of bugs. Most of
these have been fixed on trunk already, but I've documented them below to help
anyone else who might be testing ruby 2.1 in production.
@naruse I think we should backport these patches to the ruby_2_1 branch and
release 2.1.1 sooner rather than later, as some of the bugs are quite critical.
I'm happy to offer any assistance I can to expedite this process.
@knyar
knyar / statsd.lua
Created February 9, 2014 19:59
statsd interface for nginx (via ngx_lua)
-- ----------------------------------------------------------------------------
-- statsd interface for nginx
-- (c) 2014 Anton Tolchanov
-- https://gist.github.com/knyar/8905045
--
-- Usage:
-- 1. install nginx with ngx_lua;
-- 2. put this file as statsd.lua somewhere (/var/lib/nginx/lua/ will do);
-- 3. initialize stats in init_by_lua:
-- http {
@sxua
sxua / UIAppearance.md
Created September 18, 2013 17:19
UIAppearance methods (including iOS 7)

UIActivityIndicatorView

5.0

@property (readwrite, nonatomic, retain) UIColor *color

UIBarButtonItem