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 = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
module.exports = sleep; |
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
//long version | |
const objectify = object => ( | |
object.isArray() | |
? | |
object.map(element => objectify(element)) | |
: | |
({ | |
...object.toObject(), | |
_id: object._id.toString(), | |
}) |
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
// Do not use this class yet, please just use the Collection class | |
class DB { | |
constructor(collections) { | |
if ( | |
collections !== null && | |
collections !== undefined && | |
collections !== [] | |
) { | |
//this._db = collections.map((s, i) => ({ ...s, id: i })); | |
if (collections instanceof Object) { |
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
async function jraph(argv: JraphOptions){ | |
let url = argv.url; | |
let headers = { 'Content-Type': 'application/json' } | |
let body = JSON.stringify({query: argv.query}); | |
let fetch_options = { | |
method: argv.method, | |
headers, | |
body | |
}; | |
//returns request as JSON |
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
interface JraphOptions{ | |
url: string; | |
method: "post" | "POST" | "get" | "GET" | "put" | "PUT" | "delete" | "DELETE"; | |
query: string; | |
} | |
async function jraph(argv: JraphOptions){ | |
let url = argv.url; | |
let headers = { 'Content-Type': 'application/json' } | |
let body = JSON.stringify({query: argv.query}); |
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 | |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | |
# Install repo | |
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' | |
# Update apt-get | |
sudo apt-get update | |
# Install | |
sudo apt-get install code-insiders |
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
https://answers.microsoft.com/en-us/ie/forum/ie11-iewindows_10/inspect-element-in-edge-why/64704ef0-4880-44df-b9c2-d90d8a34885d |
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"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<meta name="redirect" content="./path/to/redirect/"> | |
<title>304 Permanent Redirect</title> | |
</head> | |
<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
<template> | |
<div id="root"> | |
<center> | |
<div id="turntable"> | |
<div id="table-shadow"></div> | |
<div id="table-feet"></div> | |
<div id="wood"> | |
<div id="grain1"></div> | |
<div id="grain2"></div> | |
<div id="grain3"></div> |
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
function GetSortOrder(prop) { | |
return function(a, b) { | |
if (a[prop] > b[prop]) { | |
return 1; | |
} else if (a[prop] < b[prop]) { | |
return -1; | |
} | |
return 0; | |
} | |
} |