Skip to content

Instantly share code, notes, and snippets.

View dcominottim's full-sized avatar

Danilo dcominottim

View GitHub Profile
#cloud-config
autoinstall:
version: 1
locale: en_US.UTF-8
keyboard:
layout: us
identity:
hostname: ubuntu
username: danilo
@dcominottim
dcominottim / git_submodules.md
Created January 2, 2026 20:50 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules - Basic Explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@dcominottim
dcominottim / Hyper-V PCI-Passthroug.ps1
Created May 16, 2023 22:56 — forked from Ruffo324/Hyper-V PCI-Passthroug.ps1
Hyper-V PCIe passthrough CheatSheet
# Change to name of TARGET-VM.
$vm='CHANGE_ME'
# Change to PCI device location (💡 Location).
$Location = 'CHANGE_ME'
# Enable CPU features.
Set-VM -GuestControlledCacheTypes $true -VMName $vm
# Host-Shutdown rule must be changed for the VM.
Set-VM -Name $vm -AutomaticStopAction TurnOff
@dcominottim
dcominottim / getfreeport.go
Created June 5, 2022 20:53 — forked from sevkin/getfreeport.go
get free port in golang
// GetFreePort asks the kernel for a free open port that is ready to use.
func GetFreePort() (port int, err error) {
var a *net.TCPAddr
if a, err = net.ResolveTCPAddr("tcp", "localhost:0"); err == nil {
var l *net.TCPListener
if l, err = net.ListenTCP("tcp", a); err == nil {
defer l.Close()
return l.Addr().(*net.TCPAddr).Port, nil
}
}
@dcominottim
dcominottim / gist:6056129c997928f3960d30b842593fad
Created March 9, 2021 13:17
How to set up Conda, tensorflow, MKL/BLIS, and AI-Benchmark
# download miniconda from
# https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
# open an elevated Miniconda terminal (will appear on Windows' Start Screen/Menu)
# create a separate, virtual Python env for MKL
conda create --name aib-mkl
# switch to the newly created env
conda activate aib-mkl
@dcominottim
dcominottim / bin-cc.md
Created July 23, 2019 17:03 — forked from erikhenrique/bin-cc.md
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
@dcominottim
dcominottim / gist:83fe63c205d5ec1509c6a793085c3ec4
Created November 20, 2018 18:43 — forked from msszczep/gist:a77c9361b9dfff6f8f57bf772ef5c2a4
Python script to filter "memorable" words from MRC Psycholinguistic Database
from itertools import product
final_answer = set()
for a in open('mrc2.dct'):
cols = a.split(' ', 1)
b = list(cols[0])
c = int(b[28] + b[29] + b[30]) # concreteness rating
i = int(b[31] + b[32] + b[33]) # imagery rating
f = int(b[25] + b[26] + b[27]) # familiarity rating
@dcominottim
dcominottim / LabeledEnum.java
Created November 27, 2016 14:33 — forked from jedvardsson/LabeledEnum.java
How to implement a custom Hibernate enum type indexed on a label
public interface LabeledEnum {
String getLabel();
}
@dcominottim
dcominottim / FilteredArrayAdapter.java
Created October 14, 2016 05:35 — forked from tobiasschuerg/FilteredArrayAdapter.java
Android Arrayadapter with text filtering for the use with a TextWatcher.
/**
* Arrayadapter (for Android) with text filtering for the use with a TextWatcher.
* Note: the objects in the List need a valid toString() method.
* @author Tobias Schürg
*
*/
public class FilteredArrayAdapter extends ArrayAdapter<ImageObject> {