Skip to content

Instantly share code, notes, and snippets.

@ehansen31
ehansen31 / settings.json
Last active September 27, 2017 02:02
vscode settings
// Place your settings in this file to overwrite the default settings
{
// Controls the font size in pixels.
"editor.fontSize": 18,
// Controls auto save of dirty files. Accepted values: "off", "afterDelay", "onFocusChange" (editor loses focus), "onWindowChange" (window loses focus). If set to "afterDelay", you can configure the delay in "files.autoSaveDelay".
"files.autoSave": "afterDelay",
// Controls the delay in ms after which a dirty file is saved automatically. Only applies when "files.autoSave" is set to "afterDelay"
"files.autoSaveDelay": 1,
@ehansen31
ehansen31 / Cors.js
Last active August 9, 2017 12:26
Snippet that should be placed after app.use(express) that should allow cors from any domain
app.use(function(req, res, next) {
res.header('Access-Control-Allow-Credentials', true);
res.header('Access-Control-Allow-Origin', req.headers.origin);
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept');
if ('OPTIONS' == req.method) {
res.send(200);
} else {
next();
}
@ehansen31
ehansen31 / launch.json
Created August 4, 2017 12:51 — forked from auchenberg/launch.json
VSCode + React debug config
{
"version": "0.2.0",
"configurations": [
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}/src"
}