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
"""Hello world, with a genetic algorithm. | |
https://twitter.com/matthen2/status/1769368467067621791 | |
""" | |
import random | |
import time | |
from dataclasses import dataclass | |
from itertools import chain | |
from typing import Iterable, List |
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 Prologue { | |
constructor() { | |
this.originalConsole = { | |
log: console.log, | |
warn: console.warn, | |
error: console.error, | |
}; | |
const urlParams = new URLSearchParams(window.location.search); | |
const logsParam = urlParams.get("logs"); |
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
/** | |
* Prologue is a utility class that monkey patches the browser window's console.log, | |
* console.warn, and console.error functions by wrapping them. It allows for filtering | |
* console logs based on tags specified in the URL. | |
* | |
* @remarks | |
* This class is a utility for efficient debugging and logging in the browser environment. | |
* | |
* @example | |
* // Creating an instance of Prologue |
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
worker1 = `self.onmessage = function(e) { | |
self.postMessage('msg from worker'); | |
};` | |
const blob = new Blob([ | |
worker1 | |
], { type: "text/javascript" }) | |
// Note: window.webkitURL.createObjectURL() in Chrome 10+. | |
const worker = new Worker(window.URL.createObjectURL(blob)); |
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
Array.prototype.randomItem = function () { | |
return this[Math.floor(Math.random() * this.length)]; | |
}; | |
const names = ["Aaran", "Aaren", "Aarez", "Aarman", "Aaron", "Aaron-James", "Aarron", "Aaryan", "Aaryn", "Aayan", "Aazaan", "Abaan", "Abbas", "Abdallah", "Abdalroof", "Abdihakim", "Abdirahman", "Abdisalam", "Abdul", "Abdul-Aziz", "Abdulbasir", "Abdulkadir", "Abdulkarem", "Abdulkhader", "Abdullah", "Abdul-Majeed", "Abdulmalik", "Abdul-Rehman", "Abdur", "Abdurraheem", "Abdur-Rahman", "Abdur-Rehmaan", "Abel", "Abhinav", "Abhisumant", "Abid", "Abir", "Abraham", "Abu", "Abubakar", "Ace", "Adain", "Adam", "Adam-James", "Addison", "Addisson", "Adegbola", "Adegbolahan", "Aden", "Adenn", "Adie", "Adil", "Aditya", "Adnan", "Adrian", "Adrien", "Aedan", "Aedin", "Aedyn", "Aeron", "Afonso", "Ahmad", "Ahmed", "Ahmed-Aziz", "Ahoua", "Ahtasham", "Aiadan", "Aidan", "Aiden", "Aiden-Jack", "Aiden-Vee", "Aidian", "Aidy", "Ailin", "Aiman", "Ainsley", "Ainslie", "Airen", "Airidas", "Airlie", "AJ", "Ajay", "A-Jay", "Ajayraj", "Ak |
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 raceMachine = Machine({ | |
id: 'Racing Game', | |
initial: 'lobby', | |
states: { | |
lobby: { | |
on: { | |
TIMER: 'start' | |
} | |
}, | |
start: { |
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
// Your shadow map comparison, this is builtin to ThreeJS | |
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { | |
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); | |
} | |
float getShadow () { | |
float texelSize = 1.0 / shadowMapPixelDimension; | |
float shadowStepSize = 0.5; // adjust to taste |
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
{ | |
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36", | |
"lighthouseVersion": "2.3.0", | |
"generatedTime": "2017-07-31T04:19:13.908Z", | |
"initialUrl": "https://piggahbro.ddns.net/gaming/forums/", | |
"url": "https://piggahbro.ddns.net/gaming/forums/", | |
"audits": { | |
"is-on-https": { | |
"score": true, | |
"displayValue": "", |
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
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
NewerOlder