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
[<Struct>] | |
type Vector = | |
{ X: float; Y: float; Z: float } | |
static member (*) (k, v: Vector) = { X = k * v.X; Y = k * v.Y; Z = k * v.Z } | |
static member (-) (v1: Vector, v2: Vector) = { X = v1.X - v2.X; Y = v1.Y - v2.Y; Z = v1.Z - v2.Z } | |
static member (+) (v1: Vector, v2: Vector) = { X = v1.X + v2.X; Y = v1.Y + v2.Y; Z = v1.Z + v2.Z } | |
static member Dot (v1: Vector, v2: Vector) = v1.X * v2.X + v1.Y * v2.Y + v1.Z * v2.Z | |
static member Mag (v: Vector) = sqrt (v.X * v.X + v.Y * v.Y + v.Z * v.Z) | |
static member Norm (v: Vector) = | |
let mag = Vector.Mag v |
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
html, body { | |
margin: 0; | |
padding: 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
const QUOTE = '"'; | |
const SEPARATOR = ','; | |
const ROW_SEPARATOR = '\n'; | |
export function parseCsv(content: string) { | |
const len = content.length; | |
const data = []; | |
let row = []; | |
let isEscaped = false; | |
let 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
CRASH! Pude escucharlo perfectamente. CRASH! Hizo mi corazón cuando Cintia lo tiro a través del bosque. | |
- Cómo...? - pregunte con el alma en un hilo, al borde del llanto. | |
- Ya no te soporto mas, oíste bien, eres una puta, vete de aquí, no te quiero cerca mio. | |
- pero Cin... | |
Un movimiento veloz y... dos centímetros, eso fue la distancia que separaba la daga de Cintia de mi nariz. | |
- Ya me has oido, fuera de aquí o te abro en canal. |
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 node | |
const meUrl = import.meta.url; | |
const icon = await fetch(new URL('./icon.png', meUrl)); | |
const element = import.meta.scriptElement ?? { remove() {} }; | |
element.remove(); | |
// Fields & privates |
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 a = new Life(); | |
a.pos = new Vector(10, 10); | |
a.setParameter(Parameter.ENERGY, 100); | |
a.setParameter(Parameter.WEIGHT, 1); | |
a.setParameter(Parameter.FOOD, x => x.hasParameter(Parameter.IS_PLANT)); | |
a.addSense(new Sight({ radius: 10, angle: 270, precision: 1 })) | |
a.addSense(new Hearing({ radius: 1, angle: 360, }) |
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
button.click(); // nothing | |
event = document.createEvent ('MouseEvents'); | |
event.initEvent('click', true, true); | |
button.dispatchEvent(click) // nothing | |
// here I discover `event.isTrusted` | |
event = document.createEvent ('MouseEvents'); | |
event.initEvent('click', true, true); |
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 DEFAULT_VERSION = 0; | |
export class ClientStorage { | |
constructor(key, { | |
isSessionOnly = false, | |
version = DEFAULT_VERSION, | |
} = {}) { | |
this.key = key; | |
this.version = version; | |
this.storage = isSessionOnly ? sessionStorage : localStorage; |
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
choco install spotify slack steam greenshot nodejs docker-desktop vscode sublimetext3 notepadplusplus gitkraken visualstudio2017community octave blender magicavoxelviewer -y |
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 fs = require('fs'); | |
const { promisify } = require('util'); | |
const fs_open = promisify(fs.open); | |
const fs_read = promisify(fs.read); | |
const fs_close = promisify(fs.close); | |
let debug; | |
try { | |
debug = require('debug'); | |
} catch(error) { |