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 sleep = s => new Promise(r => setTimeout(r, s*1000)); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link | |
rel="stylesheet" | |
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" | |
/> | |
<style> | |
body { |
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
nmap --open -v -p 22 192.168.0.1-64 | grep Discovered |
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 IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Mocha All", |
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
// dummy callback func; randomly calls success or failure callback after 1 sec | |
const myFunc = (a, b, callback) => { | |
setTimeout(() => | |
Math.random() > 0.5 ? callback(null, 'success!') : callback('fail :('), | |
1000) | |
} | |
// test the dummy func | |
myFunc('foo', 'bar', (err, res) => { | |
if (err) { |
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 subtitles = {} // replace with subtitles content | |
subtitles.events.map(ev => ev.segs[0].utf8.replace('\n', ' ')).join(' ') |
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
<!doctype html> | |
<html lang="en"> <!-- necessary to define language here to get English hyphenation --> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
:root { | |
--article-padding: 1.5em; | |
} | |
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
-- requires airports, runways, and airport_frequencies tables to be present with the correct data types | |
-- example output row: | |
-- ident name ATIS CTAF TWR GND elevation_ft runways | |
-- KHWD Hayward Executive Airport 126.7 120.2 118.9 121.4 52 10L-28R 3107'x75', 10R-28L 5694'x150' | |
SELECT | |
ident, | |
name, | |
-- "pivot" frequency data from rows to columns | |
MAX(CASE WHEN airport_frequencies.type = 'ATIS' THEN airport_frequencies.frequency_mhz END) ATIS, |
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
/* ballots in the form: | |
* { userID: [ firstChoice, secondChoice, ... ], | |
* userID: [ ... ], | |
* ... } | |
*/ | |
const instantRunoff = ballots => { | |
// initialize an map from choices to number of votes | |
const votes = {}; |
NewerOlder