Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View JanPlazovnik's full-sized avatar
🥐

Jan Plazovnik JanPlazovnik

🥐
View GitHub Profile
@JanPlazovnik
JanPlazovnik / bot.ts
Created March 16, 2024 23:49
Set gif avatar/banner to bot via discord.js
// discord developer dashboard doesnt yet allow uploading gif banners or avatars, so you need to do it via their api
// some gifs end up being "corrupted", as in they'll flicker black or look like they were shat out by a hellhound
// not sure yet why, maybe it's a filesize/dimensions kinda thing
const url = 'url.gif';
const banner = await axios.get(url, { responseType: 'arraybuffer' });
const base64 = Buffer.from(banner.data).toString('base64');
const base64Image = `data:image/gif;base64,${base64}`;
@JanPlazovnik
JanPlazovnik / anilist.css
Last active July 7, 2022 21:17
Custom AnilList styling
/* https://anilist.co/user/relevantcroissant/ */
/* Fixes the site not using proper colors */
* {
scrollbar-color: rgb(var(--color-red)) rgba(0, 0, 0, 0);
}
.hamburger svg {
color: rgb(var(--color-red)) !important;
}
@JanPlazovnik
JanPlazovnik / jsend.ts
Created June 5, 2022 09:44
TypeScript implementation of the JSend specification
export interface ApiResponse {
status: 'success' | 'fail' | 'error';
data?: any;
message?: any;
}
export class jsend {
// https://github.com/omniti-labs/jsend
public static success(data: any): ApiResponse {
return {
@JanPlazovnik
JanPlazovnik / estudij-course-remover.js
Last active May 26, 2022 12:26
A Tampermonkey script that removes any blacklisted courses from the page
// ==UserScript==
// @name Remove old classes from eŠtudij
// @author Jan Plazovnik
// @include https://estudij.um.si/
// @version 1
// @grant none
// ==/UserScript==
(function () {
'use strict';