Skip to content

Instantly share code, notes, and snippets.

View Gabryxx7's full-sized avatar
:electron:

Gabriele Marini, Ph.D Gabryxx7

:electron:
View GitHub Profile
@Gabryxx7
Gabryxx7 / js-logger-extended.js
Last active February 14, 2024 10:24
A one-file-import javascript file to color console.* functions output. Also includes a chat-like terminal print
const COLORS = {
RED1: '\x1b[38;5;9m',
GREEN1: '\x1b[38;5;77m',
YELLOW1: '\x1b[38;5;190m',
WHITE: '\x1b[38;5;231m',
CYAN1: '\x1b[38;5;44m',
ORANGE1: '\x1b[38;5;214m',
RESET: '\x1b[0m',
};
@Gabryxx7
Gabryxx7 / config.json
Last active December 22, 2023 17:14
OneDrive automated files downloader
{
"main_folder_link": "https://unimelbcloud-my.sharepoint.com/:f:/g/personal/marinig_student_unimelb_edu_au/xxxxxxx....",
"root_folder_list_link": "https://unimelbcloud-my.sharepoint.com/personal/deys_student_unimelb_edu_au/_api/web/GetListUsingPath(DecodedUrl=@a1)/RenderListDataAsStream?@a1=%27%2Fpersonal%2Ffolder%5Fgabry...",
"downloads_folderBAK": "./downloads/",
"downloads_folder": "/home/marinig/downloads/",
"zip_main_link": "https://australiaeast1-mediap.svc.ms/transform/zip?cs=",
"zip_headers": {
"authority": "australiaeast1-mediap.svc.ms",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "en-AU,en;q=0.9",
@Gabryxx7
Gabryxx7 / .gitignore
Last active June 11, 2022 09:14
Download and Upload all Canvas' Speed Grader's data including rubric comment, rating and submission times
node_modules/
package-lock.json
package.json
*quokka*
token.txt
*.json
*.csv
@Gabryxx7
Gabryxx7 / wordle_solution.js
Last active February 7, 2022 11:46
Wordle Solution
var La = ["cigar", "rebut", "sissy", "humph", "awake", "blush", "focal", "evade", "naval", "serve", "heath", "dwarf", "model", "karma", "stink", "grade", "quiet", "bench", "abate", "feign", "major", "death", "fresh", "crust", "stool", "colon", "abase", "marry", "react", "batty", "pride", "floss", "helix", "croak", "staff", "paper", "unfed", "whelp", "trawl", "outdo", "adobe", "crazy", "sower", "repay", "digit", "crate", "cluck", "spike", "mimic", "pound", "maxim", "linen", "unmet", "flesh", "booby", "forth", "first", "stand", "belly", "ivory", "seedy", "print", "yearn", "drain", "bribe", "stout", "panel", "crass", "flume", "offal", "agree", "error", "swirl", "argue", "bleed", "delta", "flick", "totem", "wooer", "front", "shrub", "parry", "biome", "lapel", "start", "greet", "goner", "golem", "lusty", "loopy", "round", "audit", "lying", "gamma", "labor", "islet", "civic", "forge", "corny", "moult", "basic", "salad", "agate", "spicy", "spray", "essay", "fjord", "spend", "kebab", "guild", "aback", "motor", "alone
@Gabryxx7
Gabryxx7 / xor_encryption.js
Last active August 18, 2021 04:38
Javascript token generation
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function encrypt(plaintext, key) {
let cyphertext = [];
// Convert to hex to properly handle UTF8
plaintext = Array.from(plaintext).map(function (c) {
@Gabryxx7
Gabryxx7 / bib_references_tidyup.R
Last active August 8, 2021 01:41
Tidy up bibtext references with R: Adds missing DOIs from titles and converts each citation to the correct format (I'm using acm).
if(!requireNamespace("remotes", quietly = TRUE)) { install.packages("remotes") }
if(!requireNamespace("remotes", quietly = TRUE)) { install.packages("devtools") }
remotes::install_github("wkmor1/doi2bib", upgrade ="never")
remotes::install_github("ropensci/fulltext", upgrade ="never")
remotes::install_github("ropensci/bibtex", upgrade ="never")
devtools::install_github("quanteda/readtext", upgrade ="never")
remotes::install_github("ropensci/rcrossref", upgrade ="never")
remotes::install_github("ropensci/rplos")
remotes:install_github("ropensci/aRxiv")
remotes::install.packages("RecordLinkage")
@Gabryxx7
Gabryxx7 / bupaRefresh.py
Last active February 4, 2022 04:22
Automatic refresh and booking editing for Bupa Visa Medical Services
import os
import selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located, element_to_be_clickable
from selenium.common.exceptions import ElementClickInterceptedException
import time
@Gabryxx7
Gabryxx7 / slack_export.py
Created June 7, 2021 01:46
Export Slack messages from your Slack workspace
"""
Author: Gabriele Marini @Gabryxx7
How to run it:
1. Create a Slack App (https://api.slack.com/start/overview#creating)
2. Give it all the permissions you need (usually all the read ones except for the admin persmissions)
3. Create a new config.yaml file that looks like this:
SLACK_BOT_TOKEN: "xoxp-123abvcsafas-xxxxx-xxxxxx-..."
timeframe:
@Gabryxx7
Gabryxx7 / prime_numbers_flower.R
Last active June 29, 2021 07:28
Prime flower graph in R
library(tidyverse)
library(patchwork)
## Read first 10000 digits of prime number!
prime <- read_csv(file="http://www.naturalnumbers.org/P-100000.txt", col_names=F)
names(prime) <- c("nth_prime","prime","int") ## int = interval from previous prime number
## Function to Draw Frlower
my_flower <- function(points=5000,num_colour=9,col_option="magma",angle=pi*(3-sqrt(5)), point_size=1,...){
flower <- tibble(
n = c(1:points), ## number of points
@Gabryxx7
Gabryxx7 / pdf_stats.ipynb
Last active June 29, 2021 07:29
Submissions PDF Stats
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.