This file contains 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
const API_KEY = 'YOUR_API_KEY'; | |
const auth = 'Basic ' + btoa(`${API_KEY}:`); | |
const currentYear = new Date().getYear(); | |
const startDate = `${currentYear}-01-01`; | |
const endDate = `${currentYear}-12-31`; | |
const endpoint = `https://api.chartmogul.com/v1/metrics/mrr?start-date=${startDate}&end-date=${endDate}`; | |
function loadItems() { | |
const req = new Request(endpoint); |
This file contains 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
.... | |
//This is how you'd do on ExpressJS 3.0 | |
app.get('/my/route1/', function (req, res, next) { | |
req.url = '/other/route2/'; | |
next('route'); | |
}); | |
app.get('/other/route2/', function (req, res, next) { | |
res.send('I am other route 2'); |
This file contains 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
# Dropbox has a hacky way to take control over your computer without you knowing | |
# These commands avoid that. | |
# | |
# https://news.ycombinator.com/item?id=12463338 | |
# http://applehelpwriter.com/2016/07/28/revealing-dropboxs-dirty-little-security-hack/ | |
# http://applehelpwriter.com/2016/08/29/discovering-how-dropbox-hacks-your-mac/ | |
# 1. Remove executable and suid bits and lock dbaccessperm file. | |
cd /Library/DropboxHelperTools/Dropbox_u502 |
This file contains 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
function sc_info() { | |
local sc_type=false | |
local sc_branch | |
local sc_dirty=0 | |
if [[ -f .git/HEAD || -n "$(git rev-parse --is-inside-work-tree 2> /dev/null)" ]]; then | |
# elif which git &> /dev/null && [[ -n "$(git rev-parse --is-inside-work-tree 2> /dev/null)" ]]; then | |
sc_type="git" | |
local ref=$(git symbolic-ref -q HEAD 2> /dev/null) |
This file contains 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 FRAME_TIME = 1000 / 60; | |
var DAMPING = 0.945; | |
function applyDamping(vel) { | |
return vel * DAMPING; | |
} | |
function applySpeed(x, vel) { | |
return x + vel; | |
} |
This file contains 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 admin; | |
db.createUser( | |
{ | |
user: "user", | |
pwd: "pass", | |
roles: [ "root" ] | |
} | |
); | |
use database; |