Skip to content

Instantly share code, notes, and snippets.

View cuzzea's full-sized avatar
🎯
Focusing

Vlad Rotaru cuzzea

🎯
Focusing
View GitHub Profile
@momer
momer / example-hash.go
Created May 8, 2014 13:17
Golang example of creating a timestamped key for an immutable key/value store like Groupcache.
package main
import "fmt"
import "time"
import "encoding/hex"
import "hash/fnv"
func main() {
h := fnv.New64a()
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active July 5, 2024 09:40
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@SKempin
SKempin / Git Subtree basics.md
Last active June 27, 2024 07:56
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this: