Skip to content

Instantly share code, notes, and snippets.

View gustavocd's full-sized avatar
:octocat:
Loading...

Gustavo Castillo gustavocd

:octocat:
Loading...
View GitHub Profile
@jose-mdz
jose-mdz / README.md
Last active April 18, 2024 05:26
Orthogonal Diagram Connector

Orthogonal Connectors

This algorithm returns the points that form an orthogonal path between two rectangles.

How to Use

// Define shapes
const shapeA = {left: 50,  top: 50, width: 100, height: 100};
const shapeB = {left: 200, top: 200, width: 50, height: 100};
@jose-mdz
jose-mdz / README.md
Last active December 9, 2023 03:37
Draw round corners path in JavaScript

Round Corner Path

[x] Tested

Usage

const canvas = document.getElementById('myCanvas');
const context = canvas.getContext('2d');
const points = [
 {x: 100, y: 100},
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active May 5, 2024 13:25
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@embano1
embano1 / client.go
Last active April 11, 2024 13:46
gRPC Graceful Shutdown on Client and Server
package main
import (
"context"
"grpc-tutorial/greeter"
"io"
"log"
"os"
"os/signal"
"sync"
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active May 3, 2024 12:56
Online Resources For Web Developers (No Downloading)
@joncalhoun
joncalhoun / ..README.md
Last active May 30, 2023 05:29
Most of my settings for a new mac

Chrome

  • Download & install Chrome
  • Login & sync settings/whatever else

Mac OS settings

  • General -> Use dark menu bar
  • General -> Default web browser: Google Chrome
@sebmarkbage
sebmarkbage / Infrastructure.js
Last active May 2, 2024 03:11
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}
@itsanna
itsanna / spiral_order.go
Created March 21, 2017 01:19
Print 2-D array in spiral order in Golang
package main
import "fmt"
/*
Print 2-D array in spiral order
numbers := [
[2, 4, 6, 8],
@bowmanmike
bowmanmike / dynamic_function_calls.go
Created February 22, 2017 19:06
Golang Dynamic Function Calling
package main
import (
"fmt"
)
// Use map[string]interface{} to pair functions to name
// Could maybe use anonymous functions instead. Might be clean
// in certain cases
var funcMap = map[string]interface{}{