# -*- coding:utf-8 -*- | |
""" | |
lib/RedisSessionStore.py | |
~~~~~~~~~~~~~~ | |
Flask 0.7, session store in redis | |
ref by https://gist.github.com/994937 |
const publicPath = 'public'; | |
// Node os module | |
// The os module provides a number of operating system-related utility methods. | |
// It can be accessed using: | |
const os = require('os'); | |
// Using a single monolithic configuration file impacts comprehension and | |
// removes any potential for reusability. | |
// As the needs of your project grow, you have to figure out the means to manage | |
// webpack configuration more effectively. |
var tty = require('tty') | |
var net = require('net') | |
var sock = net.createConnection(1337) | |
sock.on('connect', function () { | |
process.stdin.resume(); | |
tty.setRawMode(true) | |
}) |
Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.
// 1. npm init | |
// 2. npm install --save webpack webpack-dev-server babel-loader babel-preset-es2015 | |
// 3. mkdir dist && touch index.html | |
// 4. Include `<script src="/bundle.js"></script>` inside index.html | |
// 5. mkdir src && touch src/index.js | |
// 6. Add some code to index.js (e.g. `console.log('Hello, World!')) | |
// 7. npm start | |
// 8. Browse to http://localhost:8080/dist/ | |
const webpack = require('webpack') |
/* | |
* | |
* A simple S3 library written because the other implementation doesn't meet needs and is outdated. | |
* | |
* What this library is good for: | |
* | |
* ** Can send files any size (although S3 is currently limited at 5 gigs) | |
* ** Streams files from disk to socket -- minimal memory footprint and very efficient | |
* ** Uses sockets to support 100 Continue (especially usefull for large files) | |
* - the body is only sent after amazon approves the signed header |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'
var insertCSS = require('insert-css') | |
var domify = require('domify') | |
var css = ".button { display: inline-block; font-family: Arial; background-color: papayawhip; padding: 10px; border: 1px solid salmon; }" | |
var html = '<div class="button">BUTTON</div>' | |
// inserts new <style> tag into the <head> | |
insertCSS(css) | |
// append the html elements that domify returns to the <body> |