Skip to content

Instantly share code, notes, and snippets.

View stringparser's full-sized avatar
🏠
Working from home

Javier Carrillo Milla stringparser

🏠
Working from home
View GitHub Profile
/*! normalize.css v1.0.1 | MIT License | git.io/normalize */
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1}
audio:not([controls]){display:none;height:0}
[hidden]{display:none}
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}
html,button,input,select,textarea{font-family:sans-serif}
body{margin:0}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}

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

//
// README:
// - Listens for PUSH events
// - Fetches the ref pushed via the given remote
// - Sets the repositories HEAD to latest ref
// - Checks out the new HEAD (--force)
// - Install dependencies from package.json
// - Calls `npm run reload` (My app uses this)
// - Calls `nginx -s reload` (My app also uses this)
//
@stringparser
stringparser / composer.js
Created April 1, 2015 15:11
composing async functions
var store = {}; // lets say here we store things to map a string to a function
function Stack(){} // so we can identify composed functions
Stack.prototype.onHandle = function(next){
// measure times or other things
}
Stack.prototype.onHandleError = function(err){
if(err instanceof Error){ throw err; }

Disclaimer: This is an unofficial post by a random person from the community. I am not an official representative of io.js. Want to ask a question? open an issue on the node-forward discussions repo

io.js - what you need to know

io-logo-substack

  • io is a fork of node v0.12 (the next stable version of node.js, currently unreleased)
  • io.js will be totally compatible with node.js
  • the people who created io.js are node core contributors who have different ideas on how to run the project
  • it is not a zero-sum game. many core contributors will help maintain both node.js and io.js

Keybase proof

I hereby claim:

  • I am stringparser on github.
  • I am stringparser (https://keybase.io/stringparser) on keybase.
  • I have a public key whose fingerprint is 1801 9FA4 E47C 2CB8 A543 EBA3 7202 1D35 C4F2 9BCB

To claim this, I am signing this object:

//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person

The browser field is provided by a module author as a hint to javascript bundlers or component tools when preparing modules for client side use.

terms

Below are common terms used in the rest of the document

server

This is a non-dom based javascript execution environment. It usually only contains the base javascript language spec libraries and objects along with modules to communicate with OS features (available through commonjs require).

client

@stringparser
stringparser / document.addEventListener
Created October 26, 2014 00:45
document.addEventListener('keydown', function(e){ /* do stuff */ })
var util = { };
document.addEventListener('keydown', function(e){
var key = util.key[e.which];
if( key ){
e.preventDefault();
}
if( key === 'F1' ){
@stringparser
stringparser / index.js
Last active August 29, 2015 14:07
Boom, require dir
var fs = require('fs');
var path = require('path');
var fileList = fs.readdirSync(
path.resolve(path.dirname(module.parent.filename), path.basename(__dirname))
).slice(1);
exports = module.exports = { };
fileList.forEach(function(fileName){