http://2ality.com/2015/01/template-strings-html.html http://2ality.com/2015/01/es6-strings.html http://2ality.com/2012/12/template-strings-xregexp.html http://2ality.com/2016/05/template-literal-whitespace.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/log/nginx_*.log { | |
daily | |
compress | |
delaycompress | |
rotate 2 | |
missingok | |
nocreate | |
sharedscripts | |
postrotate | |
test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy_http_version 1.1; | |
proxy_set_header Connection ""; | |
https://gist.github.com/miguelmota/6912559 | |
# The upstream module is the link between Node.js and Nginx. | |
# Upstream is used for proxying requests to other servers. | |
# All requests for / get distributed between any of the servers listed. | |
upstream helloworld { | |
# Set up multiple Node.js webservers for load balancing. | |
# max_fails refers to number of failed attempts | |
# before server is considered inactive. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var mcache = require('memory-cache'); | |
app.set('view engine', 'jade'); | |
var cache = (duration) => { | |
return (req, res, next) => { | |
let key = '__express__' + req.originalUrl || req.url | |
let cachedBody = mcache.get(key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Relay from 'react-relay'; | |
import { relayStore } from 'app/clientStores'; // relayStore = Relay.Store; | |
import App from 'app/_components/App/App'; | |
import Menu from 'app/Menu/Menu'; | |
import MainPage from 'app/MainPage/MainPage'; | |
import Page404 from 'app/_components/Page404/Page404'; | |
import LoadingPage from 'app/_components/LoadingPage/LoadingPage'; | |
import BrokenPage from 'app/_components/BrokenPage/BrokenPage'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let relayStore; | |
function relayCreateStore() { | |
const env = new Relay.Environment(); | |
env.injectNetworkLayer(new Relay.DefaultNetworkLayer('/graphql')); | |
if (__DEV__) { | |
RelayNetworkDebug.init(env); | |
} | |
env.reset = () => relayCreateStore(); | |
env.mutate = ({ | |
query, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-console, import/first */ | |
import path from 'path'; | |
import express from 'express'; | |
import expressStaticGzip from 'express-static-gzip'; | |
import graphqlHTTP from 'express-graphql'; | |
import PrettyError from 'pretty-error'; | |
import bodyParser from 'body-parser'; | |
import raven from 'raven'; | |
import morgan from 'morgan'; | |
import { graphqlBatchHTTPWrapper } from 'react-relay-network-layer'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sortable extends React.Component { | |
componentDidMount() { | |
// Every React component has a function that exposes the | |
// underlying DOM node that it is wrapping. We can use that | |
// DOM node, pass it to jQuery and initialize the plugin. | |
// You'll find that many jQuery plugins follow this same pattern | |
// and you'll be able to pass the component DOM node to jQuery | |
// and call the plugin function. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// simple express server | |
var express = require('express'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.sendfile('./public/index.html'); |