#!/usr/bin/env bash
set -euxo pipefail
IFS=$'\n\t'
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
"use strict"; | |
class Graph { | |
#InitialCourses; | |
constructor(edges) { | |
this.E = new Map(); | |
this.V = new Set(); | |
this.I = new Map(); | |
this.#InitialCourses = []; | |
if (edges.length === 0) { | |
return; |
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
class Graph { | |
constructor(edgesArray) { | |
this.V = new Set(); | |
this.E = {}; | |
if(edgesArray.length === 0) { | |
return this; | |
} | |
edgesArray.forEach(edge => { |
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
/** | |
* @param {string} num1 | |
* @param {string} num2 | |
* @return {string} | |
*/ | |
var multiply = function(num1, num2) { | |
if(num1 === "0" || num2 === "0") { | |
return "0"; | |
} | |
const numbers = Array.from({length: num2.length}, _ => "0"); |
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
class Future { | |
#value = null; | |
#error = null; | |
#successCallbacks = []; | |
#failureCallback = () => {} | |
#finalCallback = () => {} | |
constructor(fn) { | |
const onSuccess = (value) => { | |
this.#value = value; |
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
/** | |
* @param {character[][]} board | |
* @return {boolean} | |
*/ | |
var isValidSudoku = function(board) { | |
toString(board); | |
const len = board.length; | |
let valid = true; | |
for(let i = 0; i < len && valid; i++) { | |
valid = valid && isValidRow(board, i) && isValidColumn(board, i); |
NOTE: This is an article by Chris Taylor, originally posted on his blog, but the blog was removed at some point. I resurected it from the WayBack Machine without the authors permission, but post it here for posterity's sake, so others may be able to find it.
by Chris Taylor
FEB 10TH, 2013
React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.
Table of Contents
React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.
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
(function deleteQuickly() { | |
var t = document.querySelector('details.flex-md-order-1 > details-dialog:nth-child(2) > div:nth-child(3) > p:nth-child(2) > strong:nth-child(1)').innerText | |
document.querySelector('details.flex-md-order-1 > details-dialog:nth-child(2) > div:nth-child(3) > form:nth-child(3) > p:nth-child(3) > input:nth-child(1)').value = t | |
document.querySelector('button.btn-danger:nth-child(4)').disabled = false | |
document.querySelector('button.btn-danger:nth-child(4)').click() | |
})() |
NewerOlder