Skip to content

Instantly share code, notes, and snippets.

View YakDriver's full-sized avatar
🕳️
🌑

Dirk Avery YakDriver

🕳️
🌑
View GitHub Profile
@jenkek
jenkek / gist:8553579
Last active May 7, 2018 18:21
How to: Delete a remote Git tag
# remove local tag
git tag -d tagname-123
# remove remote tag
git push origin :refs/tags/tagname-123
# delete multiple tags by patterns
for tag in $(git tag -l '[production|tusur]*'); do git tag -d $tag; git push origin :refs/tags/$tag; done
@gbaman
gbaman / graphql_example.py
Created November 1, 2017 00:18
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@JoaquimLey
JoaquimLey / create_new_ssh_key.md
Last active April 4, 2024 11:07
Generating a new SSH key and adding it to the ssh-agent

Generating a new ssh-key

Open Terminal. Paste the text below, substituting in your GitHub email address.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

This creates a new ssh key, using the provided email as a label

Generating public/private rsa key pair.

@posener
posener / go-table-driven-tests-parallel.md
Last active April 4, 2024 19:45
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active April 22, 2024 08:04
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