Skip to content

Instantly share code, notes, and snippets.

View jonasbn's full-sized avatar
🐙
conducting sub-optimal multitasking

Jonas Brømsø jonasbn

🐙
conducting sub-optimal multitasking
View GitHub Profile
@mijorus
mijorus / howtoCherryPickLazygit.md
Last active July 31, 2024 08:10
Lazygit: how to cherry-pick

I'm writing this because I found it harder than expected, but actually is super easy.

  1. From the "Commit" panel (or the "Branches" panel) focus on a commit an press c, you can select more than one
  2. Go to the "Commit" panel (in the "Branches" panel it doesn't work) and press v, will ask for confirmation.
  3. DONE

EDIT: With the latest release, c and v are replaced with Shift + c and Shift + v

@jonlabelle
jonlabelle / npm_version_cheatsheet.md
Last active November 14, 2024 14:23
npm version cheatsheet

npm version cheatsheet

npm uses Semantic Versioning

npm uses Semantic Versioning. Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards compatible manner, and
  3. PATCH version when you make backwards compatible bug fixes.
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active November 14, 2024 18:54
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
#!/bin/sh
echo "# 24-bit (true-color)"
# based on: https://gist.github.com/XVilka/8346728
term_cols="$(tput cols || echo 80)"
cols=$(echo "2^((l($term_cols)/l(2))-1)" | bc -l 2> /dev/null)
rows=$(( cols / 2 ))
awk -v cols="$cols" -v rows="$rows" 'BEGIN{
s=" ";
m=cols+rows;
@chrodriguez
chrodriguez / dockerhub-readme-update.sh
Last active November 10, 2022 21:39
How to update dockerhub readme automatically
#!/bin/bash
usage() {
if [ ! -z $1 ]; then
echo -e "ERROR:\n" 1>&2
fi
echo "Usage: $0 -f /path/to/README.md -u dockerhub-username [-r dockerhub-repo-prefix] -n repo-name" 1>&2
exit 1;
}
while getopts ":r:u:f:n:" o; do
@Tekki
Tekki / mojo-vue.pl
Last active April 26, 2021 16:24
Mojolicious - Vue.js Example
#!/usr/bin/env perl
use Mojolicious::Lite -signatures;
get '/' => sub ($c) {
$c->render(template => 'index');
};
get '/api/:region' => sub ($c) {
my %regions = (
@inadarei
inadarei / minikube-sierra.md
Last active October 20, 2020 01:57
Minikube Setup: Docker for Mac / Sierra

Prerequisite: latest Docker for Mac on MacOS Sierra

$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
FROM perl
WORKDIR /perl
ENTRYPOINT ["carton", "exec"]
RUN cpanm -n Carton
COPY tarball.tgz /perl
RUN cd /perl && tar zxf tarball.tgz && carton install --deployment
@henrik
henrik / macos_sierra_upgrade.md
Last active February 28, 2017 21:25
macOS Sierra update: Ruby, Rails, homebrew, VirtualBox/Vagrant, Elixir etc.

My notes from updating to macOS Sierra, as a Ruby/Rails developer working in VirtualBox/Vagrant.

Homebrew

brew doctor told me to fix /usr/local ownership:

sudo chown -R $(whoami) /usr/local

It also said Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool.

@tara-gibbs
tara-gibbs / hey
Last active August 26, 2018 13:27
Handy OS X notification util to alert you with notification and speech that a long running process has completed.
#!/bin/bash
/usr/bin/osascript -e "display notification \"$*\" with title \"Hey!\""
/usr/bin/say -v Alex "Hey! $*"
# Setup: Add this to your /usr/local/bin in a file called hey. chmod +x it to make it an executable.
# Usage: sleep 2 && hey wake up!