Skip to content

Instantly share code, notes, and snippets.

View zisra's full-sized avatar
🪨
Kicking rocks

zisra

🪨
Kicking rocks
View GitHub Profile
@zisra
zisra / books.md
Created June 17, 2024 13:09
Reading list
  • Alan Watts - Nature, Man and Woman
  • Alasdair MacIntyre - Rational and dependent animals. Why Human Beings Need Virtues
  • Alasdair MacIntyre - History of Ethics
  • Alasdair Macintyre - After Virtue
  • Alberto Coffa, R. S. Cohen, L. Laudan - Physics, Philosophy and Psychoanalysis Essays in Honour of Adolf Grünbaum
  • Alessandra Campo, Simone Gozzano - Einstein vs Bergson
  • Alex Malpass, Marianna Antonutti Marfori - The History of Philosophical and Formal Logic From Aristotle to Tarski
  • Alex Rosenberg, Lee McIntyre - Philosophy of Science A Contemporary Introduction
  • Alexander Miller - Contemporary Metaethics An Introduction
  • Alexander R. Pruss - Actuality, Possibility, and Worlds
@zisra
zisra / pig-game.js
Created May 22, 2024 23:56
Pig game
const ITERATIONS_USED = 10_000;
const MAX_LIMIT = 10;
const DICE_FACES = 6;
const MAX_DIGITS = 4;
function rollDice() {
return Math.floor(1 + Math.random() * DICE_FACES);
}
function rollDiceUntilBreak(limit) {
const rows = document.querySelectorAll('#dataGridRight table tbody tr.listCell');
const result = [];
rows.forEach(row => {
const cells = row.querySelectorAll('td');
const title = cells[0].textContent.trim();
if(!cells[2]) return;
// claim_daily_login
const res = await fetch("https://gateway.venge.io/?request=request_ads_coin", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/x-www-form-urlencoded",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site"
},
"referrer": "https://venge.io/",
function getNumber(el) {
const value = el.querySelector('[data-e2e="video-views"]').textContent;
if (value.endsWith("K")) {
return parseInt(value.replace("K", "")) * 1_000;
} else if (value.endsWith("M")) {
return parseInt(value.replace("M", "")) * 1_000_000;
}
}
echo -e "
127.0.0.1 marriott.com
" | sudo tee -a /etc/hosts >/dev/null
@zisra
zisra / eloCalculator.ts
Last active October 23, 2023 01:19
Calculate ELO
const K_FACTOR = 20;
const RATING_SCALING = 400;
interface Player {
isWin: boolean;
elo: number;
}
interface Result {
firstPlayer: Player;
const lessonUUID = window.location.pathname.split("/")[2];
const sleep = (m) => new Promise((r) => setTimeout(r, m));
fetch(
`https://api.garbanzo.io/api/assignment/${lessonUUID}?localized_date_time=2023-09-14%2011:31:06`,
{
headers: {
authorization: localStorage.getItem("auth._token.local"),
},
method: "GET",
@zisra
zisra / googleClassroom.js
Created September 9, 2023 11:39
Remove Google Classroom classes
window.onload = () => {
const blackList = [
"Math",
"Science",
];
const observer = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
if (mutation.type === "childList" && mutation.addedNodes.length > 0) {
const matchingElements = Array.from(
@zisra
zisra / weather.ino
Last active August 11, 2023 14:39
Weather arduino
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecure.h>
#include <Arduino_JSON.h>
#include <LedControl.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
int latitude = 48.83;
int longitude = 10.09;