Skip to content

Instantly share code, notes, and snippets.

View igorjs's full-sized avatar
🌏
Away

igor.js igorjs

🌏
Away
View GitHub Profile
@igorjs
igorjs / docker-for-mac.md
Created July 31, 2023 01:08 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@igorjs
igorjs / gpg_git_signing.md
Created May 3, 2023 22:24 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@igorjs
igorjs / cli-libs.md
Created April 22, 2023 11:24 — forked from thomd/cli-libs.md
An opinionated list of libraries for creating command line interfaces #list #cli
@igorjs
igorjs / lima-on-m1-mac-installation-guide.md
Created April 17, 2023 05:53 — forked from toricls/lima-on-m1-mac-installation-guide.md
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

@igorjs
igorjs / igorjs.zsh-theme
Last active March 19, 2023 22:59
Oh My ZSH Custom Theme
# prompt cursor fix when exiting vim
echo -en '\e[0 q'
prompt_symbol() {
local symbol="➜"
if [[ $UID -eq 0 ]]; then
symbol="#"
fi
symbol="%{$fg_bold[grey]%}${symbol}%{$reset_color%}"
echo -n "$symbol"
@igorjs
igorjs / angularjs-providers-explained.md
Created February 22, 2023 05:56 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@igorjs
igorjs / change-codec.md
Created February 1, 2023 01:47 — forked from dvf/change-codec.md
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

function calcDistanceInMetresBetweenTwoPoints(Point1, Point2) {
const EARTH_RADIUS = 6371e3; // 6,371,000 metres
const latitude1 = (Point1.lat * Math.PI) / 180;
const latitude2 = (Point2.lat * Math.PI) / 180;
const deltaLatitude = ((Point2.lat - Point1.lat) * Math.PI) / 180;
const deltaLongitude = ((Point2.lon - Point1.lon) * Math.PI) / 180;
const angle =
@igorjs
igorjs / git-branch-protection.md
Created October 28, 2022 06:26 — forked from edudobay/git-branch-protection.md
Command-line script for protecting/unprotecting branches in a GitHub repository

(To be improved)

Requirements

  • httpie (which provides the http command) — pip install httpie

Setup

  • Save the git-branch-protection.sh as git-branch-protection somewhere in your path (something like ~/bin or ~/.local/bin if you already use it)
  • Generate a GitHub token and save it as ~/.config/github_token.