Skip to content

Instantly share code, notes, and snippets.

View vitor-diego-s's full-sized avatar
🏠
Working from home

Vitor Diego vitor-diego-s

🏠
Working from home
View GitHub Profile
@vitor-diego-s
vitor-diego-s / sources.list
Created April 12, 2022 13:47 — forked from ishad0w/sources.list
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@vitor-diego-s
vitor-diego-s / random_method
Created July 1, 2020 14:41
Angular 8 location access
getQueryStringStuff(){
console.log('Router class', this.router.url);
this.route.queryParams.subscribe(params => {
console.log('ActivatedRoute class', params);
});
@vitor-diego-s
vitor-diego-s / euclidean_distance_python
Created January 29, 2020 16:55
Calculates the Euclidean distance between two vectors
def euclidean_distance(coordenates):
'''
Calculates the Euclidean distance between two vectors
coordenates:
{
'target': {
'x':current_x,
'y':current_y
},
@vitor-diego-s
vitor-diego-s / make_hash_python_structures
Last active January 29, 2020 16:53
Good reference for hash creation - based on some kind of data type - https://stackoverflow.com/users/660554/jomido ( Author )
def make_hash(target):
'''
Makes a hash from a dictionary, list, tuple or set to any level, that contains
only other hashable types (including any lists, tuples, sets, and
dictionaries).
https://stackoverflow.com/questions/5884066/hashing-a-dictionary
'''
if isinstance(target, (set, tuple, list)):
@vitor-diego-s
vitor-diego-s / kubedump.sh
Created January 14, 2020 14:09 — forked from negz/kubedump.sh
Dump Kubernetes cluster resources as YAML
#!/usr/bin/env bash
set -e
CONTEXT="$1"
if [[ -z ${CONTEXT} ]]; then
echo "Usage: $0 KUBE-CONTEXT"
exit 1
fi
package main
import (
"fmt"
"time"
)
//This is a simple example of Go routines
//Our program executes some calculus using concurrency