Skip to content

Instantly share code, notes, and snippets.

View onmax's full-sized avatar
💭
🌍

Max onmax

💭
🌍
View GitHub Profile
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{342e5e83-faf1-4849-b17e-a7e37aaab403}",
"profiles": {
"defaults": {
"colorScheme": "Dracula"
},
"list": [
@onmax
onmax / mean_politecnicavirtual.js
Created July 28, 2020 13:16
Small JS script to obtain your mean grade using the UPM page
// First you need to click the button to show your grades.
// Then open the console using F12 and copy and paste the following code
const tables = document.querySelectorAll("table#tabla_expediente")
let acc = 0
let sum = 0
tables.forEach(t => {
Array.from(t.rows).forEach(r => {
const col = r.cells[r.cells.length - 1]
matches = /\((\d+\,*\d*)\)/gm.exec(col.innerText);
if(matches !== null) {
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/max/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1="\[\033[01;32m\][\@]\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[01;34m\]\W\[$(tput sgr0)\] \[\e[91m\]\$(parse_git_branch)\e[00m\]\n > \[$(tput sgr0)\]"
@onmax
onmax / script.js
Last active January 26, 2021 12:02
Automated information gathering from DAAD webpage to a CSV format
let zip = (...rows) => [...rows[0]].map((_,c) => rows.map(row => row[c]))
/* Gets all info from one page in a CSV format */
function getCSVpage() {
let divs = Array.from(document.querySelectorAll(".view-tab li > div"))
const names = divs.map(d => d.querySelector("h3 strong").outerText).map(m => m.replace(",","."))
const links = divs.map(d => d.querySelector("h3 a").href)
const unis = divs.map(d => d.querySelector("h3 span").outerText).map(m => m.replace(",","."))
const tuition = divs.map(d => d.querySelector("table tbody tr:nth-child(2) td:last-child").outerText).map(m => m.replace(",","."))
const admision = divs.map(d => d.querySelector("table tbody tr:nth-child(4) td:last-child").outerText)
FROM alpine:3.11
# Install Instantclient Basic Light Oracle and Dependencies
RUN apk --no-cache add libaio libnsl libc6-compat curl && \
cd /tmp && \
curl -o instantclient-basiclite.zip https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip -SL && \
unzip instantclient-basiclite.zip && \
mv instantclient*/ /usr/lib/instantclient && \
rm instantclient-basiclite.zip && \
ln -s /usr/lib/instantclient/libclntsh.so.19.1 /usr/lib/libclntsh.so && \
@onmax
onmax / install-gradle.sh
Created April 15, 2021 07:15
Installs gradle using the command line
# from https://linuxize.com/post/how-to-install-gradle-on-ubuntu-20-04/
sudo apt update
# Make sure to have java
# sudo apt install openjdk-11-jdk
# java -version
VERSION=6.5.1
wget https://services.gradle.org/distributions/gradle-${VERSION}-bin.zip -P /tmp
sudo unzip -d /opt/gradle /tmp/gradle-${VERSION}-bin.zip
docker rmi -f $(docker images -f "dangling=true" -q)
@onmax
onmax / contracts.sh
Last active July 19, 2021 09:26
This gist allows you to deploy alastria contracts in a local node using geth and truffle
# cloning repo
git clone https://github.com/alastria/alastriaID-truffle-contracts
cd alastriaID-truffle-contracts
git checkout develop
npm install
npm run migrateLocal
npm run initLocal
@onmax
onmax / README.md
Created November 14, 2021 13:12
Quick calendar with tailwindcss