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
from concurrent.futures import Future | |
from datetime import datetime | |
import queue | |
import threading | |
from time import sleep | |
import weakref | |
all_threads_queues = weakref.WeakKeyDictionary() | |
shutdown_happened = False |
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
// Floyd Warshall algorithm implementation | |
/* Floyd Warshall algorithm is an algorithm for finding shortest paths in a weighted graph */ | |
const min = (a, b) => a < b ? a : b | |
const warshall = graph => { | |
const len = graph.length | |
const myGraph = [] |
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
console.log('\x1b[36m%s\x1b[0m', 'I am cyan'); // cyan | |
Colors reference: | |
Reset = "\x1b[0m" | |
Bright = "\x1b[1m" | |
Dim = "\x1b[2m" | |
Underscore = "\x1b[4m" | |
Blink = "\x1b[5m" | |
Reverse = "\x1b[7m" | |
Hidden = "\x1b[8m" |
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
now scale your-deployment-url 1 |
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
weirdReverse=a=>a.sort(_=>1) |
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
{ | |
"presets": ["flow"], | |
"plugins": [ | |
["react-flow-props-to-prop-types"] | |
] | |
} |
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
const arr = [1, 4, 2, 5, 200, 6, 9] | |
const qsort = (arr) => { | |
if (arr.length < 2) { | |
return arr | |
} else { | |
const pivot = arr[Math.floor(Math.random() * arr.length)] | |
const less = arr.filter(value => value < pivot) | |
const greater = arr.filter(value => value > pivot) |
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
const addToCart = (cart, pokemon) => { | |
if (inCart(cart, pokemon)) { | |
cart.find(item => item.name === pokemon.name).count += 1; | |
} else { | |
pokemon['count'] = 1 | |
cart.push(pokemon) | |
} | |
return cart | |
} |
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
{ | |
"data": [ | |
{ | |
"id": 0, | |
"name": "Bulbasaur", | |
"price": 30, | |
"image": "https://img.pokemondb.net/artwork/bulbasaur.jpg", | |
"type": ["grass", "poison"], | |
"species": "Seed Pokemon", | |
"abilities": [ |
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
{ | |
"title": "test json", | |
"data": [ | |
{ "name": "firstName1", "price": 300 }, | |
{ "name": "firstName2", "price": 400 }, | |
{ "name": "firstName3", "price": 500 } | |
] | |
} |
NewerOlder