Skip to content

Instantly share code, notes, and snippets.

View emafriedrich's full-sized avatar

Emanuel Friedrich emafriedrich

  • Blaze
  • Posadas, Misiones, Argentina
View GitHub Profile
@emafriedrich
emafriedrich / random-number-generator.js
Last active April 5, 2024 13:24
Random Number Generator with Chi Squared test
const crypto = require('crypto');
// Can set the game param to fix any bias you find
const randomDecimalFromHash = ({ hash, game, charsToTake = 5, startsFromPosition = 0 }) => {
hash = hash + game;
const cycle = 3;
const cycleOffset = (cycle * 2) % hash.length;
const hashSegmentForInterval = hash.substring(cycleOffset, cycleOffset + 2);
const randomInterval = parseInt(hashSegmentForInterval, 16) % charsToTake + 1;
@emafriedrich
emafriedrich / randomelement.sql
Created June 22, 2024 11:28
Select random array element PostgreSQL
update table set your_colum = (array['foo', 'bar', 'baz'])[floor(random() * 3 + 1)]; -- replace 3 with your array length
@emafriedrich
emafriedrich / stupid-conversation-with-chagGPT.txt
Created June 27, 2024 19:13
Most frustrating CHAT GPT conversation ever (spanish version)
Original chat in spanish https://chatgpt.com/c/e033ec6c-297b-45ef-924e-47ae4082130b. There are another things that i asked before, but ignore that and just go to the frustrating conversation that starts with "
sabes, te cuento un sueño que tengo"
sabes, te cuento un sueño que tengo
ChatGPT
¡Claro! Cuéntame sobre tu sueño. Estoy aquí para escucharte.
mira este codigo
import _ from 'lodash';