Skip to content

Instantly share code, notes, and snippets.

View openhoangnc's full-sized avatar
🌊
coding for living

Nguyen Cong Hoang openhoangnc

🌊
coding for living
  • Vietnam
View GitHub Profile
@openhoangnc
openhoangnc / mac-login-items-locations.md
Created December 7, 2022 03:43
macOS login items locations

/Library/LaunchDaemons/

/Library/LaunchAgents/

~/Library/LaunchAgents/
@openhoangnc
openhoangnc / git-conditional-config.md
Created April 7, 2022 03:36
Git conditional config

As of git version 2.13, git supports conditional configuration includes. In this example we clone Company A's repos in ~/company_a directory, and Company B's repos in ~/company_b.

In your .gitconfig you can put something like this.

[includeIf "gitdir:~/company_a/"]
  path = .gitconfig-company_a
[includeIf "gitdir:~/company_b/"]
  path = .gitconfig-company_b
//usr/bin/env go run $(which $0) "$@"; exit "$?"
// Usage:
// chmod +x script.go
// ./script.go param1 param2 ...
// #or put script.go in a PATH directory, then run
// script.go param1 param2 ...
package main

macOS 11.5.2

location: Vietnam

I got this error while installing rosetta by clicking the "Install" button:

“Installing Rosetta 2 on this system is not supported.”

Run this command in the terminal should work

@openhoangnc
openhoangnc / package.json
Created May 28, 2021 08:51
Ignore node_modules from go mod
{
"scripts": {
"postinstall": "echo > node_modules/go.mod"
}
}
@openhoangnc
openhoangnc / mini-server-setup.md
Last active May 7, 2021 02:46
Mini server setup
@openhoangnc
openhoangnc / inputrc
Created August 28, 2020 04:54 — forked from snipe/inputrc
~/.inputrc for nice bash history up-arrows. This allows you to search through your history using the up and down arrows … i.e. type "cd /" and press the up arrow and you'll search through everything in your history that starts with "cd /". Create ~/.inputrc and fill it with this:
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
#include <Arduino.h>
// the setup function runs once when you press reset or power the board
void setup()
{
uint32_t outputMode8Pin = 0x77777777;
/**
0x7 = 0 1 1 1
CNF1 CNF0 MODE1 MODE0
General perpose output + open-drain + Max output speed 50MHz
@openhoangnc
openhoangnc / ec2.ubuntu.archive.sh
Created April 28, 2020 16:02
EC2's ubuntu archive
sudo sed -i -E "s/([^\/]+\.)?archive\.ubuntu\.com/ap-southeast-1.ec2.archive.ubuntu.com/" /etc/apt/sources.list
@openhoangnc
openhoangnc / 1_WTF.md
Created October 11, 2018 04:11 — forked from valpackett/1_WTF.md
Kindle dictionary template

Kindle dictionary template

Use it with KindleGen

kindlegen dic.opf