#Simple MongoDB Security Tutorial
###1 - Start mongod without any "security option"
$ mongod --port 27017
"scripts": { | |
"postinstall" : "node -e \" try { require('fs').symlinkSync('../app', 'node_modules/~', 'dir') } catch(e) { if (e.code !== 'EEXIST') { console.log('Couldn\\'t create a symlink in node_modules:'); console.log(e.message); } } \"" | |
} |
#!/usr/bin/env node | |
var debug = require('debug')('invoice'); | |
var app = require('../app'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var https = require('https'); | |
var http = require('http'); | |
var key = fs.readFileSync('/etc/ssl/private/server.key'); |
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
// Version 2, December 2004 | |
// | |
// Copyright (C) 2015 Swen Wenzel <[email protected]> | |
// | |
// Everyone is permitted to copy and distribute verbatim or modified | |
// copies of this license document, and changing it is allowed as long | |
// as the name is changed. | |
// | |
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
public static int lighten(int color, double fraction) { | |
int red = Color.red(color); | |
int green = Color.green(color); | |
int blue = Color.blue(color); | |
red = lightenColor(red, fraction); | |
green = lightenColor(green, fraction); | |
blue = lightenColor(blue, fraction); | |
int alpha = Color.alpha(color); | |
return Color.argb(alpha, red, green, blue); | |
} |
#Simple MongoDB Security Tutorial
###1 - Start mongod without any "security option"
$ mongod --port 27017
/* | |
* Nunjucks + Express | |
* I couldn't find anything that helped me setup the enviornment | |
* correctly for these in the latest vesion of Express 4 (at the time | |
* of writing this). | |
* | |
* This Gist for those that want to keep using Nunjucks with Express 4. | |
* This also goes over working with a Nunjucks environment to use custom | |
* filters, extensions, etc. | |
* |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
@echo off | |
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |