Skip to content

Instantly share code, notes, and snippets.

View ThomRoman's full-sized avatar

ThomRoman

View GitHub Profile
@Klerith
Klerith / vite-testing-config.md
Last active October 9, 2024 20:01
Vite + Testing + Jest - Completo

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@Klerith
Klerith / vite-testing-config.md
Last active December 29, 2024 21:06
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@mikej312
mikej312 / openvpn.md
Created July 3, 2020 00:21
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 / 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"
)
@alexyslozada
alexyslozada / Go - Genera los días festivos de Colombia
Last active December 16, 2019 23:00
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"
)
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@Lugriz
Lugriz / print-graph-with-level.py
Last active February 13, 2020 06:16
Prints each vertex with its levels
"""
PRINT GRAPH WITH LEVEL
"""
from queue import Queue
# Defining vertex class
class Vertex():
def __init__(self, value):
self.value = value
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) {
import time
print "..."
time.sleep(1)
print "..."
print "..."
print "..."
print "..."
time.sleep(1)
print "..."
@endolith
endolith / DFT_ANN.py
Last active October 11, 2024 07:04
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
N = 32
batch = 10000