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

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
@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; }
//
// 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)
//

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

/*! 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}
@stringparser
stringparser / texsvg.hs
Last active August 29, 2015 14:25 — forked from lierdakil/texsvg.hs
Pandoc filter to convert math to inline svg using latex and dvisvgm
import Text.Pandoc.JSON
import System.Directory
import System.FilePath ((</>))
import qualified Data.Hash.MD5 as MD5
import System.IO.Temp
import System.Process
import Control.Monad (unless)
main :: IO ()
main = toJSONFilter mathToSvg
var _ = require('underscore');
var Backbone = require('backbone');
var cheerio = require('cheerio');
var request = require('request');
Backbone.ajax = function(options) {
options.json = true;
return request(options, function(error, result) {
if (error) {
@stringparser
stringparser / oneToCloneThemAll.sh
Created July 31, 2015 16:59
Clone all private repos of an organization
curl -u <token>:x-oauth-basic -s https://api.github.com/orgs/<orgName>/repos | node -e '
var repos="";
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", function(data){
repos += data;
});
process.stdin.on("end", function(){
JSON.parse(repos).forEach(function(repo){
require("child_process").spawn("git", ["clone", repo.html_url], {stdio: "inherit"});
@stringparser
stringparser / _.isEqual.coffee
Created June 26, 2016 08:56
smaller lodash.isEqual
__toString = Object.prototype.toString
isEqual = (a, b) ->
if arguments.length < 2
return false # cannot compare
typeA = typeOf(a)
typeB = typeOf(b)
# falsy values can be compared by reference except for NaN
@stringparser
stringparser / background.js
Created August 9, 2016 21:11 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});