Skip to content

Instantly share code, notes, and snippets.

View onmax's full-sized avatar
💭
🌍

Max onmax

💭
🌍
View GitHub Profile
@onmax
onmax / README.md
Created November 15, 2021 12:54
Quick example how to work with RxJS as a Pipe of messages

Quick example how to work with RxJS as a Pipe of messages

See it in work

@onmax
onmax / private-key.ts
Last active November 15, 2021 09:28
Get private key as string from keystore
const keythereum = require('keythereum')
const keystore = require("path/to/keystore.json")
const password = "PASSWORD"
const privateKey: string = keythereum.recover(
password,
keystore
)
@onmax
onmax / README.md
Created November 14, 2021 13:12
Quick calendar with tailwindcss
@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
docker rmi -f $(docker images -f "dangling=true" -q)
@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
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 / 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)
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)\]"
# 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