Skip to content

Instantly share code, notes, and snippets.

@patrickdawson
patrickdawson / ConsulConfiguration.conf
Last active March 6, 2019 14:39
[nginx] Example api config
location /consul {
set $upstream consul;
rewrite ^/consul(.*) /_consul$1 last;
}
location /ui {
set $upstream consul;
rewrite ^(.*)$ /_consul$1 last;
}
@patrickdawson
patrickdawson / Vagrantfile
Created February 1, 2019 07:43
[Vagrant with oh-my-zsh] #Vagrant
config.vm.provision "shell",
inline: "sh -c '$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)'",
privileged: false
@patrickdawson
patrickdawson / index.html
Created February 5, 2018 19:08
JS Bin Delay rxjs events // source https://jsbin.com/kidicot
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Delay rxjs events">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script>
<button id="btn1">Gen Save Event</button>
@patrickdawson
patrickdawson / main.cpp
Last active December 2, 2017 10:35
Curl Multithreading Test with Connection Pool Share (C++ 11, std)
//
// main.cpp
// CurlDirectTest
//
// Created by Patrick Dawson on 01.12.17.
// Copyright © 2017 Patrick Dawson. All rights reserved.
//
#include <iostream>
#include <thread>
@patrickdawson
patrickdawson / gist:b9ce3e425b18a5d2d598a752cea4e3f6
Created February 3, 2017 09:53
JSCheckAttributesOfObject with lodash
_.every(["info", "warn", "error"], _.partial(_.has, messenger))
@patrickdawson
patrickdawson / app.js
Last active November 28, 2016 06:04
Express-Angular: Catch 404
// 404 catch
app.all('*', (req, res) => {
console.log(`[TRACE] Server 404 request: ${req.originalUrl}`);
res.status(200).sendFile(`${path.join(__dirname, 'public')}/index.html`);
});