Skip to content

Instantly share code, notes, and snippets.

View eduardonunesp's full-sized avatar
🐚

Eduardo Pereira eduardonunesp

🐚
View GitHub Profile
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active April 19, 2024 11:13
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@nikoheikkila
nikoheikkila / README.md
Last active April 15, 2024 17:15
Fish Shell function for sourcing standard .env files

envsource

⚠️ NOTE (20.5.2023): I don't really use this function at all anymore since there are now tools such as Taskfile, which reads the .env file for me sparing me the need to pollute my session with environment variables.


I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

@samiraguiar
samiraguiar / MC Cheat Sheet
Last active April 13, 2024 10:22 — forked from maciakl/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
You can also use "ESC" instead of "ALT", which is useful on Macbooks.
Main View
---------------------------------------------------------------
- File/directory operations
@wizioo
wizioo / gitignore_per_git_branch.md
Last active April 10, 2024 20:19
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

@ezimuel
ezimuel / sign.sh
Created March 14, 2016 15:50
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
#![warn(rust_2018_idioms)]
#[derive(Debug)]
pub struct StrSplit<'haystack, D> {
remainder: Option<&'haystack str>,
delimiter: D,
}
impl<'haystack, D> StrSplit<'haystack, D> {
pub fn new(haystack: &'haystack str, delimiter: D) -> Self {
@ThadeuLuz
ThadeuLuz / dddsBrasileiros.json
Last active April 5, 2024 00:32
Objeto JSON com Estados Brasileiros por DDD e lista de DDDs por Estados.
{
"estadoPorDdd": {
"11": "SP",
"12": "SP",
"13": "SP",
"14": "SP",
"15": "SP",
"16": "SP",
"17": "SP",
"18": "SP",
@tscholl2
tscholl2 / aes.go
Last active March 29, 2024 11:06
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@ghoneycutt
ghoneycutt / hosts.md
Created May 2, 2018 21:13
default /etc/hosts

macos

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost