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
module.exports = { | |
email: { | |
address: 'youraddress@gmail.com', | |
password: 'clever-password' | |
} | |
}; |
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
# renew_before_expiry = 30 days | |
version = 0.19.0 | |
archive_dir = /etc/letsencrypt/archive/my-domain.com | |
cert = /etc/letsencrypt/live/my-domain.com/cert.pem | |
privkey = /etc/letsencrypt/live/my-domain.com/privkey.pem | |
chain = /etc/letsencrypt/live/my-domain.com/chain.pem | |
fullchain = /etc/letsencrypt/live/my-domain.com/fullchain.pem | |
# Options used in the renewal process | |
[renewalparams] |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name my-server.com www.my-server.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
# SSL configuration | |
listen 443 ssl http2 default_server; |
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
server { | |
server_name www.goforself.me goforself.me; | |
listen 80; | |
client_max_body_size 20M; | |
port_in_redirect off; | |
access_log /var/log/nginx/goforself.me.access.log; | |
error_log /var/log/nginx/goforself.me.error.log error; | |
root /var/www/goforself; | |
index index.php; |
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 moment = require('moment-timezone'); // https://momentjs.com/timezone/ | |
const timestamp = new Date(); | |
console.log( | |
moment(timestamp) | |
.tz('America/Vancouver') // find your zone here https://momentjs.com/timezone/docs/#/data-loading/getting-zone-names/ | |
.format('dddd, MMMM Do YYYY, h:mm:ss a (UTC Z)') | |
); |
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
NODE_ENV=production | |
PATH=/root/.nvm/versions/node/v8.11.1/bin:$PATH | |
@reboot cd /var/server/script-directory && /root/.nvm/versions/node/v8.11.1/bin/forever start myscript.js |
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 moment = require('moment'); | |
const someAction = () => console.log('Actioning...'); | |
const wait = ms => new Promise((resolve, reject) => setTimeout(resolve, ms)); | |
const startCron = async () => { | |
while (true) { | |
if ( | |
moment().date() === |
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
sudo apt-get update | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:certbot/certbot | |
sudo apt-get update | |
sudo apt-get install python-certbot-nginx |
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 xml = require('xml'); | |
module.exports = app => { | |
//processes the webhook for when a new invoice is created | |
app.post('/webhooks/new-invoice', async (req, res) => { | |
try { | |
// debugging | |
console.log(req.body); | |
const { name, verifier, object_id } = req.body; |
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
export const getURLparams = () => { | |
const pl = /\+/g; | |
const search = /([^&=]+)=?([^&]*)/g; | |
const decode = s => decodeURIComponent(s.replace(pl, ' ')); | |
const query = window.location.search.substring(1); | |
const urlParams = {}; | |
let match; | |
while ((match = search.exec(query))) { | |
urlParams[decode(match[1])] = decode(match[2]); |