Skip to content

Instantly share code, notes, and snippets.

@bangn
bangn / .cvimrc
Last active March 22, 2022 06:03
let blacklists = ["https://mail.google.com/*", "https://apglobal.atlassian.net/*"]
let barposition = "bottom"
let mapleader = ","
map T :duplicate<cr>
map <Leader>td :tabdetach<cr>
# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@bangn
bangn / fix-libncurses.md
Created April 24, 2020 01:57
Fix libncurses issue when insalling ghc
sudo apt update && sudo apt install libncurses5 -y
@bangn
bangn / Multiple SSH keys.md
Last active March 29, 2020 22:08
Using multiple SSH keys for different account/group

Using multiple SSH keys

Update ssh config

# Personal github
host github-personal
  HostName github.com
  Port 22
  AddKeysToAgent yes
  IdentityFile ~/.ssh/personal_id_rsa
@bangn
bangn / find-windows-linux.md
Created August 25, 2019 15:13
Find windows license key under linux
cat /sys/firmware/acpi/tables/MSDM
@bangn
bangn / fix-ssl-nix-macos.md
Last active July 9, 2020 05:51
Fix "SSL certificate problem: unable to get local issuer certificate" (macOS, nix)

The problem

nix-channel --update
warning: unable to download 'https://nixos.org/channels/nixpkgs-unstable': Problem with the SSL CA cert (path? access rights?) (77); using cached result
error: unable to download '/nixexprs.tar.bz2': URL using bad/illegal format or missing URL (3)

The reason

ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.$VERSION_IN_ERROR_MESSAGE.dylib
@bangn
bangn / boxstarter.ps1
Last active July 20, 2018 05:23 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

@bangn
bangn / overthinking-fizzbuzz.rb
Last active September 15, 2017 11:19
Copy a very clever fizzbuzz implementation in ruby. http://dave.fayr.am/posts/2012-10-4-finding-fizzbuzz.html
class FizzBuzz
def initialize
@printed = nil
@printers = [
lambda {|x| print (@printed = "Fizz") if x % 3 == 0},
lambda {|x| print (@printed = "Buzz") if x % 5 == 0},
lambda {|x| print (@printed = "Bazz") if x % 7 == 0}
]
end