Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
First semester of uni over!

Isaac Kogan isaackogan

😀
First semester of uni over!
View GitHub Profile
@isaackogan
isaackogan / PDFNoteGenerator.py
Last active September 13, 2022 00:36
Create Notability note from lecture PDFs
View PDFNoteGenerator.py
"Moved to https://github.com/isaackogan/LectureNoteGenerator"
@isaackogan
isaackogan / TikTokLiveTempfix.py
Last active July 21, 2022 04:53
Temporary fix to TikTokLive by providing authentication details
View TikTokLiveTempfix.py
from TikTokLive import TikTokLiveClient
from TikTokLive.types.events import ConnectEvent, CommentEvent
sessionid = "SESSION_ID_HERE"
sid_guard = "SID_GUARD_HERE"
client = TikTokLiveClient("@PERSON_YOU_WANT_TO_WATCH", **{
"headers": {
"Cookie": f"sessionid={sessionid}; sid_guard={sid_guard};"
}
@isaackogan
isaackogan / secondsToMilitaryTimestamp.js
Last active March 2, 2022 00:20
Convert seconds into DD:HH:MM:SS format that automatically removes leading values and does not include leading zeroes in the first non-zero value.
View secondsToMilitaryTimestamp.js
function secondsToMilitary(seconds) {
let negative = seconds < 0;
seconds = Math.abs(Math.floor(seconds));
/*
Less than 60 seconds
*/
if (seconds < 60) {
return "00:" + ((seconds > 10) ? seconds.toString() : '0' + seconds)
@isaackogan
isaackogan / React Site Pterodactyl Egg
Last active February 17, 2022 17:50
Serve a react site
View React Site Pterodactyl Egg
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1",
"update_url": null
},
"exported_at": "2022-02-17T12:45:09-05:00",
"name": "NodeJS Server",
"author": "yajtpg@gmail.com",
"description": "NodeJS Universal Egg.",
@isaackogan
isaackogan / uvicorn-fastapi-egg.json
Created October 11, 2021 01:11
Pterodactyl.io Uvicorn FastAPI Python Egg
View uvicorn-fastapi-egg.json
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1",
"update_url": null
},
"exported_at": "2021-10-10T21:10:16-04:00",
"name": "FastAPI (Uvicorn)",
"author": "parker@parkervcp.com",
"description": "A Discord bot written in Python using discord.py\r\n\r\nhttps:\/\/github.com\/Ispira\/pixel-bot",
@isaackogan
isaackogan / milestone.py
Last active August 23, 2021 21:31
[Python] Milestone Caculation
View milestone.py
from typing import Optional
def roundup(x: int, tens: int) -> int:
val: int = int("1" + ("0" * tens))
return x if x % val == 0 else x + val - x % val
def halfway(x: int) -> int:
val: int = int("5" + ("0" * (len(str(x)) - 2)))