Skip to content

Instantly share code, notes, and snippets.

View johanmcos's full-sized avatar

Johan M. Cos johanmcos

  • Comcast Corporation
  • Lehigh Valley, PA
View GitHub Profile
@mariozig
mariozig / migrate_repo.sh
Last active May 26, 2024 20:57
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@mbostock
mbostock / intersections.js
Created July 12, 2012 01:25
Circle-Circle Intersection
function intersections(a, b) {
var R = a.r,
r = b.r,
dx = b.x - a.x,
dy = b.y - a.y,
d = Math.sqrt(dx * dx + dy * dy),
x = (d * d - r * r + R * R) / (2 * d),
y = Math.sqrt(R * R - x * x);
dx /= d;
dy /= d;