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
from bs4 import BeautifulSoup
from requests import get
class github():
def __init__(self, user):
self.user = user
def following(self):
return self.get_users("following")
@hctilg
hctilg / viewer.py
Last active November 9, 2024 21:08
Daramet‌ viewer
from selenium import webdriver
from selenium.webdriver.common.by import By
def run(_func):
if __name__ == '__main__':
_func()
def viewer(username, view_number):
for i in range(view_number):
try:
@AliAlmasi
AliAlmasi / PersianDate.js
Created December 15, 2023 23:00
A better way to use Persian Calendar in JS.
class PersianDate extends Date {
constructor(...args) {
super(...args);
}
toLocaleDateString = () => super.toLocaleDateString("fa-IR-u-nu-latn");
getParts = () => this.toLocaleDateString().split("/");
getDay = () => (super.getDay() === 6 ? 0 : super.getDay() + 1);
getDate = () => this.getParts()[2];
getMonth = () => this.getParts()[1] - 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>
@thelast19digitsofpi
thelast19digitsofpi / readme.txt
Created July 12, 2022 00:00
Find And Also Destroy (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@straker
straker / README.md
Last active November 7, 2024 10:35
Basic Pong HTML and JavaScript Game

Basic Pong HTML and JavaScript Game

This is a basic implementation of the Atari Pong game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When a ball goes past a paddle, the other player should score a point. Use context.fillText() to display the score to the screen
@ArtBIT
ArtBIT / GRUB_INIT_TUNE.md
Last active November 16, 2024 13:41
A collection of GRUB init tunes
@thedaviddias
thedaviddias / Preload CSS - Not blocking CSS.html
Last active October 31, 2024 00:31
Preload CSS and don't block the DOM with your CSS file request.
<link rel="preload" href="css/global.min.css" as="style" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="css/global.min.css"></noscript>
<script>
/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
!function(a){"use strict";var b=function(b,c,d){function j(a){if(e.body)return a();setTimeout(function(){j(a)})}function l(){f.addEventListener&&f.removeEventListener("load",l),f.media=d||"all"}var g,e=a.document,f=e.createElement("link");if(c)g=c;else{var h=(e.body||e.getElementsByTagName("head")[0]).childNodes;g=h[h.length-1]}var i=e.styleSheets;f.rel="stylesheet",f.href=b,f.media="only x",j(function(){g.parentNode.insertBefore(f,c?g:g.nextSibling)});var k=function(a){for(var b=f.href,c=i.length;c--;)if(i[c].href===b)return a();setTimeout(function(){k(a)})};return f.addEventListener&&f.addEventListener("load",l),f.onloadcssdefined=k,k(l),f};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this);
/*! loadCSS rel=preload po
@straker
straker / README.md
Last active November 15, 2024 21:04
Basic Snake HTML and JavaScript Game

Basic Snake HTML and JavaScript Game

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When the snake eats an apple, the score should increase by one. Use context.fillText() to display the score to the screen