Skip to content

Instantly share code, notes, and snippets.

View lmarti17's full-sized avatar
👨‍💻
Available for freelance

Lucas Martin lmarti17

👨‍💻
Available for freelance
View GitHub Profile
@lmarti17
lmarti17 / scaleToRange.js
Created September 29, 2021 09:41
Function to interpolate a value between a min and a max value.
function scaleToRange(
num: number,
in_min: number,
in_max: number,
out_min: number,
out_max: number
) {
return ((num - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
@lmarti17
lmarti17 / dev-setup.sh
Created January 7, 2018 17:38
A shell script to install all apps / packages I usually use for working as an Interactive developer (not tested for now though)
#!/usr/bin/env bash
# Install command-line tools using Homebrew.
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &