Skip to content

Instantly share code, notes, and snippets.

sudo apt-get install libonig-dev
gem install oniguruma
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@scopevale
scopevale / README.md
Last active August 29, 2015 14:07 — forked from pr1001/README.md

Wish you had some immutability in Javascript? Now you can!

var t = {a: 1, b: 2}.immutable();
console.log(t.a, t.b);
try {
  t.a = 3; // ->  Uncaught Error: a is immutable and cannot be modified.
} catch (e) {
  console.log(e);
}

var t2 = t.copy({a: 3});

var Node = function(value) {
this.value = value;
this.next=null;
return this;
};
var LinkedList = function(node){
this.head = node;
return this;
};
@scopevale
scopevale / inview.js
Last active August 29, 2015 14:20 — forked from defx/inview.js
function inView(el, fn) {
var location, size;
el.getCssValue('display')
.then(function (display) {
if (display === 'none') {
fn(false);
} else {
return el.getSize()
// This is the equivalent of the old waitsFor/runs syntax
// which was removed from Jasmine 2
waitsForAndRuns = function(escapeFunction, runFunction, escapeTime) {
// check the escapeFunction every millisecond so as soon as it is met we can escape the function
var interval = setInterval(function() {
if (escapeFunction()) {
clearMe();
runFunction();
}
}, 1);
@scopevale
scopevale / 0_reuse_code.js
Last active September 9, 2015 11:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

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

@scopevale
scopevale / gulpfile.js
Created November 15, 2015 12:19 — forked from wesbos/gulpfile.js
FAST Browserify + Reactify + Babelify
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var babelify = require('babelify');
var watchify = require('watchify');
var notify = require('gulp-notify');
@scopevale
scopevale / .agignore
Created December 8, 2015 09:05 — forked from fallwith/.agignore
The Silver Searcher ~/.agignore file
/log/
/logs/
/images/
/javascripts/
/stylesheets/
/tmp/
/vendor/
*.sql
*.tags*
*.gemtags*