module.js
var x = 10;
var y = 20;
export {x, y};
export default x;
main.js
var SomeClass = (function () { | |
//private vars | |
var bar = 1; | |
//constructor | |
var SomeClass = function () { | |
} | |
//public api | |
var exports = SomeClass.prototype; |
module.js
var x = 10;
var y = 20;
export {x, y};
export default x;
main.js
'use strict'; | |
const fs = require('fs'); | |
const path = process.argv[2]; | |
console.log('\n\nRunning script...'); | |
if (!path) { | |
console.log('Please provide a path'); | |
process.exit(); | |
} |
# Create new user and add keys | |
adduser sammy | |
usermod -aG sudo sammy | |
su - sammy | |
mkdir ~/.ssh | |
chmod 700 ~/.ssh | |
nano ~/.ssh/authorized_keys # add public key by copy and paste | |
chmod 600 ~/.ssh/authorized_keys |
ufw status # list firwall status | |
ufw allow 81/tcp # open 81 port | |
ufw deny 81/tcp # deny 81 port | |
ufw delete allow 81/tcp # Delete 81 port rule | |
ufw delete deny 81/tcp # Delete 81 port rule | |
netstat -tulpn # list processes assigned to port | |
Output:Recording: | |
Format: mkv | |
Recorder: x264 | |
Rate Control: CBR | |
BitRate: 1500 | |
CPUUsages: Medium | |
Video: | |
BaseRes: 1440x900 | |
OutputRes: 1440x900 |
const APP_PREFIX = 'repo-name' | |
const VERSION = '0.0.0.1' | |
const CACHE_NAME = APP_PREFIX + VERSION | |
const URLS = [ | |
'/repo-name/', | |
'/repo-name/index.html', | |
'/repo-name/main.css', | |
'/repo-name/sw.js', | |
] | |
self.addEventListener('install', e => e.waitUntil(swInstall())) |
// Currently works for jpeg only, | |
// CROS should be enable | |
// JPEG SPECS: | |
// http://vip.sugovica.hu/Sardi/kepnezo/JPEG%20File%20Layout%20and%20Format.htm | |
async function getSize(url) { | |
const response = await fetch(url); | |
const reader = response.body.getReader(); | |
const {value, done} = await reader.read(); |
#!/usr/bin/env node | |
const http = require('http'); | |
const getBody = (req) => { | |
return new Promise(resolve => { | |
let body = ''; | |
req.on('data', chunk => { body += chunk }); | |
req.on('end', _ => resolve(body)); | |
}) |