Skip to content

Instantly share code, notes, and snippets.

View AliAlmasi's full-sized avatar
:bowtie:
Learning JS, TS and some other things

Ali Almasi AliAlmasi

:bowtie:
Learning JS, TS and some other things
View GitHub Profile
@AliAlmasi
AliAlmasi / darkMode.html
Last active October 1, 2024 21:11
Dark Mode w/ JS
<html data-theme="light">
<head>
<title>Dark Mode w/ JS</title>
<style>
[data-theme="light"] {
--color-bg: #e5e5e5;
--color-fg: #0f0f0f;
}
[data-theme="dark"] {
@AliAlmasi
AliAlmasi / dinoCheat.js
Created July 8, 2023 02:01
Cheat for dino game on Google Chrome
javascript: function keyDown(e) {
Podium = {};
var n = document.createEvent("KeyboardEvent");
Object.defineProperty(n, "keyCode", {
get: function () {
return this.keyCodeVal;
},
}),
n.initKeyboardEvent
? n.initKeyboardEvent("keydown", !0, !0, document.defaultView, e, e, "", "", !1, "")
@AliAlmasi
AliAlmasi / ferriswheel.html
Created July 2, 2023 22:44
"Ferris wheel" with HTML & CSS. From freeCodeCamp Responsive Web Design Certification curriculum.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ferris Wheel &mdash; Ali Almasi </title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div class="wheel">
<span class="line"></span>
@AliAlmasi
AliAlmasi / tkCalc
Created August 22, 2022 21:23
Python tkinter Calculator
import tkinter as tk
def buttonpressed(i):
if i != '=':
entry.insert(tk.END, i)
else:
expression = entry.get()
try:
value = eval(expression)
new_string = f'{value: ,}'
from random import randint as rnd
from time import sleep as sl
def diff():
global diff_lvl
diff_lvl = ""
print("Select difficulty (E = Easy / N = Normal / H = Hard)")
diff_select = input("Type and Enter: ")
diff_select.lower()
if diff_select == 'e':
import time
def nam_query():
nam = input("Enter Your First Name: ")
if len(nam) == 0:
print("So, you're telling me you don't have a name?")
time.sleep(1)
nam_query()
elif len(nam) > 16: