2017/08/09 MacOS
$ ls -al ~/.ssh
/* -- webpack.config.shared.js -- */ | |
export const sharedConfig = { | |
alias: { | |
'Utils': path.resolve(__dirname, '../src/app/utils/'), | |
'Components': path.resolve(__dirname, '../src/app/components/'), | |
}, | |
}; | |
/* -- webpack.config.dev.js -- */ |
This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
(async main(){...}())
as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problemsI'll leave the rest of this document unedited, for archaeological
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
import { createProxyServer } from 'http-proxy'; | |
import url from 'url'; | |
import _ from 'lodash'; | |
module.exports = app => { | |
const proxy = createProxyServer(); | |
app.all('/api/v1/*', (req, res) => { | |
const path = _.drop(req.url.split('/'), 3); | |
proxy.proxyRequest(req, res, { | |
target: url.resolve('YOUR URL', path.join('/')), |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
Using pg.connect
is the way to go in a web environment.
PostgreSQL server can only handle 1 query at a time per conenction. That means if you have 1 global new pg.Client()
connected to your backend your entire app is bottleknecked based on how fast postgres can respond to queries. It literally will line everything up, queuing each query. Yeah, it's async and so that's alright...but wouldn't you rather multiply your throughput by 10x? Use pg.connect
set the pg.defaults.poolSize
to something sane (we do 25-100, not sure the right number yet).
new pg.Client
is for when you know what you're doing. When you need a single long lived client for some reason or need to very carefully control the life-cycle. A good example of this is when using LISTEN/NOTIFY
. The listening client needs to be around and connected and not shared so it can properly handle NOTIFY
messages. Other example would be when opening up a 1-off client to kill some hung stuff or in command line scripts.
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
/* | |
* Scaffolding | |
* Basic and global styles for generating a grid system, structural layout, and page templates | |
* ------------------------------------------------------------------------------------------- */ | |
.container | |
Sets a width of 940px which also centres the content (clears floated elements before/after) | |
.container-fluid | |
Sets a minimum width of 940px (clears floated elements before/after) |