Skip to content

Instantly share code, notes, and snippets.

View marlonmarcello's full-sized avatar

Marlon U. Marcello marlonmarcello

View GitHub Profile
@marlonmarcello
marlonmarcello / install-go-linux.md
Last active February 14, 2025 19:20
Install Go

Check the version and file name on Go's website and just update the line bellow https://go.dev/dl/

Setup paths

export GO_VERSION=1.23.6
export GOROOT=/usr/local/go/go$GO_VERSION
export GOPATH=$HOME/go$GO_VERSION
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
@marlonmarcello
marlonmarcello / change-to-new-ratio.js
Created June 9, 2017 18:36
Changing a set of values to a different ratio
function changeRatio(originalWidth, originalHeight, newWidth = 750, newHeight = 420, restrain = false) {
let ratio = w / h,
targetRatio = targetW / targetH;
let newW = targetW,
newH = newW / ratio;
if (restrain && newH > targetH) {
newH = targetH;
newW = newH * ratio;