Skip to content

Instantly share code, notes, and snippets.

@montanaflynn
montanaflynn / pget.go
Last active January 17, 2025 17:07
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index
@jpierson
jpierson / switch-local-git-repo-to-fork.md
Last active December 26, 2022 21:48 — forked from jagregory/gist:710671
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

@kmontg
kmontg / Promise.js
Created May 20, 2017 01:28
Promise Implementation
'use strict';
let [PENDING, FULFILLED, REJECTED] = [0, 1, 2];
let pn = 0;
let tick = 0;
console.log('Executing Main Script...');
let clr = setInterval(() => {
console.log('TICK #' + (++tick) + '...');
}, 0);