Skip to content

Instantly share code, notes, and snippets.

View ThomRoman's full-sized avatar

ThomRoman

View GitHub Profile
@ThomRoman
ThomRoman / curl.md
Created September 18, 2019 07:12 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ThomRoman
ThomRoman / Go-Genera-los-días-festivos-de-Colombia.go
Last active January 26, 2020 19:30 — forked from alexyslozada/Go - Genera los días festivos de Colombia
Genera los días festivos de colombia dado un año
// Genera los días festivos de colombia dado un año
// Basado en los artículos:
// https://www.festivos.com.co/calculo y https://elpais.com/elpais/2017/04/12/el_aleph/1492008750_544261.html
package main
import (
"fmt"
"time"
)

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@ThomRoman
ThomRoman / update-git.sh
Created March 22, 2020 00:10 — forked from YuMS/update-git.sh
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@ThomRoman
ThomRoman / lazy-load-nvm.sh
Last active March 22, 2020 03:34
NVM lazy loading script
#!/bin/bash
#https://virtualzero.net/blog/how-to-create-a-bash-script-to-update-ubuntu-18.04-lts
# NVM lazy loading script
#
# NVM takes on average half of a second to load, which is more than whole prezto takes to load.
# This can be noticed when you open a new shell.
# To avoid this, we are creating placeholder function
# for nvm, node, and all the node packages previously installed in the system
# to only load nvm when it is needed.
var arr = ['Sacha', 'Og', 'Haru'];
arr[Symbol.iterator] = function *() {
var i = this.length - 1;
while (i >= 0) {
yield this[i];
i--;
}
}
for (var value of arr) {
@ThomRoman
ThomRoman / openvpn.md
Created July 3, 2020 00:24 — forked from mikej312/openvpn.md
Associate usernames with IP addresses of OpenVPN clients

Tested on an OpenBSD system using OpenVPN LDAP authentication:

sed -n '/Virtual/,/GLOBAL/{//!p;}' /var/log/openvpn-status.log | awk -F'[,:]' '{print $3}' | while read -r r; do echo -n $r; fgrep $r /var/log/openvpn | fgrep -m 1 username | awk -F\' '{ print " - " $2}' ; done

@ThomRoman
ThomRoman / ipak.R
Created July 13, 2020 06:31 — forked from stevenworthington/ipak.R
Install and load multiple R packages at once
# ipak function: install and load multiple R packages.
# check to see if packages are installed. Install them if they are not, then load them into the R session.
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
window.onload = function(){
/** UNSAFE with localStorage **/
let jwt = null
onLogin(){
jwt = await login()
}
onDataFetch(){
@ThomRoman
ThomRoman / git-alias.md
Last active February 23, 2022 21:59 — forked from Klerith/git-alias.md
Useful Git Alias

git logda

git config --global alias.logda "log --oneline --graph --decorate --all

git s

git config --global alias.s "status

git sl => super log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

git ss => status short