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 = function (req, res, next) { | |
// you won't believe what happens | |
next(); | |
}; |
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
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions | |
https://medium.com/tfogo/advantages-and-pitfalls-of-arrow-functions-a16f0835799e | |
My personal rule... only use arrow functions when you need the benefit of what they do. A | |
lot of folks default to them and I think this is a bad practice. |
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 akismet = require('akismet-api'); | |
var client = akismet.client({ | |
key: process.env.AKISMET_API_KEY, | |
blog: process.env.AKISMET_BLOG_URL | |
}); | |
module.exports = client; | |
// verify akismet api key |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
<link rel="preload" href="/css/app.bundle.css" as="style"> | |
<link rel="preload" href="/js/app.bundle.js" as="script"> | |
<link rel="stylesheet" href="/css/app.bundle.css"> | |
<!--[if IE]> |
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
#!/usr/bin/env node | |
var childProcess = require('child_process'); | |
var spawn = childProcess.spawn; | |
function getStatusMessage() { | |
var bash = spawn('bash'); | |
bash.stdin.end('git status --porcelain'); | |
return new Promise(function (resolve) { | |
bash.stdout.on('data',function (data) { |
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
document.querySelectorAll('.b1').forEach(function (el) { | |
if (!el.querySelectorAll('.an > div:nth-child(1)').length) { | |
return false | |
} | |
var date = el.querySelectorAll('.an > div:nth-child(1)')[0].innerText | |
date = date.split(',')[0] | |
date = date.replace(/ /g,'-') | |
var amnt = el.querySelectorAll('.bb.cb')[0].innerText |
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
#/usr/bin/env bash | |
export AWS_CONFIG_FILE="/home/user/.aws/config" | |
export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXHRQ | |
export AWS_SECRET_ACCESS_KEY=XXXXXXXfHyR | |
/path/to/aws s3 sync /path/to/uploads/ s3://mybucket/uploads/ |
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
[Unit] | |
Description=service | |
After=network.target | |
[Service] | |
Type=simple | |
User=ubuntu | |
WorkingDirectory=/opt/service | |
ExecStart=/bin/bash -c 'exec bin/node app.js 2>&1 >> logs/console.log' | |
Restart=always |
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
UPDATE `wp_users` SET `user_pass`= MD5('password') WHERE `user_login`='ryan'; |