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
type Success<T> = { | |
data: T; | |
error: null; | |
}; | |
type Failure<E> = { | |
data: null; | |
error: E; | |
}; |
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
// ==UserScript== | |
// @name Flights From Home Revealer | |
// @namespace http://tampermonkey.net/ | |
// @version 2025-01-25 | |
// @description try to take over the world! | |
// @author itzjonas | |
// @match https://app.flightsfromhome.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=flightsfromhome.com | |
// @grant none | |
// ==/UserScript== |
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
// Remove any duplicates from an array of primitives | |
const unique = [...new Set(arr)]; | |
// Sleep in async functions. Use: await sleep(2000) | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// Type this in your code to break chrome debugger in that line. | |
debugger; | |
// Just plain english. |
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
import React from 'react'; | |
import { render } from 'react-dom'; | |
function sumOfPrimes(e) { | |
e.preventDefault(); | |
const num = document.getElementById('num').value; | |
if(num > 100000) { | |
document.getElementById('answer').innerHTML = 'ERROR: exceeds CodeSandbox infinite loop failsafe.'; |
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 starTowerNew = levels => [...Array(levels)].map((v, i) => '*'.repeat(i * 2 + 1).padStart(i + levels).padEnd(levels * 2 - 1)); | |
console.log(starTowerNew(20)); |
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
<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"> | |
<title>Search & Find</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
</head> | |
<body> | |
<div id="app" /> | |
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
class LinkedList { | |
constructor(...values) { | |
this.head = null; | |
this.length = 0; | |
this.add(...values); | |
} | |
/** | |
* Individually adds a new node to the head of the linked list. | |
* |