This file contains hidden or 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
| #!/bin/bash | |
| IPTABLES_CONF_FILE=/etc/rsyslog.d/iptables.conf | |
| echo ':msg, contains, ": IPTables Packet Dropped: " /var/log/iptables.log' > $IPTABLES_CONF_FILE | |
| echo ':msg, contains, ": IPTables Packet Dropped: " ~' >> $IPTABLES_CONF_FILE | |
| systemctl restart rsyslog | |
| # http://blog.stalkr.net/2009/10/logging-iptables-messages-with-rsyslog.html |
This file contains hidden or 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
| #!/bin/bash | |
| SENDGRID_API_KEY="" | |
| EMAIL_TO="" | |
| FROM_EMAIL="" | |
| FROM_NAME="" | |
| SUBJECT="" | |
| bodyHTML="<p>Email body goes here</p>" |
This file contains hidden or 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
| let getName = () => { | |
| return new Promise((resolve, reject) => { | |
| let name = "John Doe"; | |
| try { | |
| setTimeout (() => { | |
| resolve( name ) | |
| }, 1500) |
This file contains hidden or 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 crypto = require('crypto'), https = require('https') | |
| // -------------------------------------------------------------------- | |
| let setString = (str = '') => { | |
| return new Promise((resolve, reject) => { | |
| let _name = str || 'John Doe'; |
This file contains hidden or 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 strict' | |
| const assert = require('assert') | |
| module.exports = { | |
| getProductsCount: (req, res) => { | |
| return new Promise((resolve, reject) => { |
This file contains hidden or 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 http = require('http') | |
| let getData = (rand = 1) => { | |
| return new Promise((resolve, reject) => { | |
| try { | |
| let url = 'http://localhost:3000/db/products.count?v=' + rand |
This file contains hidden or 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 strict' | |
| global.state = { | |
| time: null, | |
| user: null, | |
| photo: null, | |
| book: null | |
| } | |
| const { getTime, getUser, getPhoto, getBook } = require('./promise_modules') |
This file contains hidden or 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 strict' | |
| global.state = { | |
| time: null, | |
| user: null, | |
| photo: null, | |
| book: null | |
| } | |
| const { getTime, getUser, getPhoto, getBook } = require('./promise_modules') |
This file contains hidden or 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
| importScripts('/js/workbox-sw.js'); | |
| workbox.setConfig({ | |
| debug : true | |
| }); | |
| workbox.core.setLogLevel(workbox.core.LOG_LEVELS.debug); | |
| workbox.skipWaiting(); | |
| workbox.clientsClaim(); | |
| workbox.core.setCacheNameDetails({ | |
| "prefix" : "nodepwa", | |
| "suffix" : "web", |
This file contains hidden or 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 strict'; | |
| require('dotenv').config(); | |
| const { | |
| HEROKU_APP_NAME, | |
| AUTH_TOKEN | |
| } = process.env; | |
| const |