Skip to content

Instantly share code, notes, and snippets.

@jansroka
jansroka / Install-ruby-3.1.0-with-rbenv-on-OSX-Monterey-12.5.md
Created August 17, 2022 19:55
Install ruby 3.1.0 with rbenv on OSX Monterey 12.5 Based on hours of fiddling and trying everything I could find and can think of. This is the config which worked for me.

Install ruby 3.1.0 with rbenv on OSX Monterey 12.5

Based on hours of fiddling and trying everything I could find and can think of. This is the config which worked for me.

1) You need to set these exports

# ruby
export PATH=/Users/jan/.rbenv/shims:$PATH
export optflags="-Wno-error=implicit-function-declaration"
@jansroka
jansroka / node-depcheck.sh
Created April 3, 2022 18:43
Find unused npm packages in package.json without using depcheck
#!/bin/bash
# source: https://stackoverflow.com/questions/22675725/find-unused-npm-packages-in-package-json/
DIRNAME=${1:-.}
cd $DIRNAME
FILES=$(mktemp)
PACKAGES=$(mktemp)
# use fd
# https://github.com/sharkdp/fd
#!/usr/bin/env bash
# Upate your hosts file - Jan Sroka <github@jansroka.com>
set -o errexit # abort on nonzero exitstatus
set -o nounset # abort on unbound variable
set -o pipefail # don't hide errors within pipes
# comment this out to remove debug output
set -x
# Ask for sudo password upfront
@jansroka
jansroka / set_default_applications.sh
Created October 24, 2021 18:00
Set default applications on OSX via duti
#!/bin/bash
# This file is based on:
#========================================================================
# FILE: set_default_apps.sh
# DESCRIPTION: Changes default apps for extensions
# AUTHOR: Scott Granneman (RSG), scott@chainsawonatireswing.com
# COMPANY: Chainsaw on a Tire Swing (http://ChainsawOnATireSwing.com)
# VERSION: 0.1
# CREATED: 09/17/2012 21:44:01 CDT
@jansroka
jansroka / brewupdate.sh
Created October 24, 2021 16:49
Update, upgrade, cleanup brew
#!/usr/bin/env bash
# Probably unnecessary double work, but this works nicely for me
brew doctor
brew update
brew upgrade
brew upgrade --cask
brew outdated --cask | grep -v arq | xargs brew reinstall --cask --force
brew cleanup
brew cleanup