$ docker
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 cacheName = 'v1'; | |
const cacheAssets = [ | |
'index.html', | |
'about.html', | |
'/css/style.css', | |
'/js/main.js' | |
]; | |
// Call Install Event |
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 cacheName = 'v2'; | |
// Call Install Event | |
self.addEventListener('install', e => { | |
console.log('Service Worker: Installed'); | |
}); | |
// Call Activate Event | |
self.addEventListener('activate', e => { | |
console.log('Service Worker: Activated'); |
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 request = require('request'); | |
const cheerio = require('cheerio'); | |
const fs = require('fs'); | |
const writeStream = fs.createWriteStream('post.csv'); | |
// Write Headers | |
writeStream.write(`Title,Link,Date \n`); | |
request('http://codedemos.com/sampleblog', (error, response, html) => { | |
if (!error && response.statusCode == 200) { |
We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc
Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server
Use this link and get $10 free. Just select the $5 plan unless this a production app.
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
{ | |
"Console Log": { | |
"prefix": "cl", | |
"body": "console.log($1);", | |
"description": "Console Log" | |
}, | |
"Named Function": { | |
"prefix": "nfn", | |
"body": ["function ${1:functionName}($2) {", " $3", "}"], | |
"description": "Named Function" |