Skip to content

Instantly share code, notes, and snippets.

@sontt9
sontt9 / export.sh
Created October 13, 2023 06:19 — forked from zhiyue/export.sh
Export apps installed by brew, brew cask and Mac App Store(using mas)
#!/bin/bash
echo -e '#!/bin/bash\n' > list.sh
echo -e '########### Brew Install List ###########' >> list.sh
brew leaves | sed 's/^/brew install /' >> list.sh &&
echo -e '\n########### Brew Cask Install List ###########' >> list.sh &&
brew cask list | sed 's/^/brew cask install /' >> list.sh &&
echo -e '\n########### Mac App Store Install List ###########' >> list.sh &&
@sontt9
sontt9 / postgres-cheatsheet.md
Created July 17, 2020 07:52 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@sontt9
sontt9 / example.puml
Created July 2, 2020 17:09 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@sontt9
sontt9 / README-Template.md
Created March 20, 2020 07:32 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@sontt9
sontt9 / setup-user.sh
Last active February 11, 2020 03:14
setup user
#!/usr/bin/env bash
# curl url | sudo bash
yum install -y git
adduser isysadmin
usermod -aG wheel isysadmin
#passwd isysadmin
su - isysadmin
@sontt9
sontt9 / setup-node.sh
Last active February 12, 2020 06:46
nvm-node-npm-install.sh
#!/usr/bin/env bash
# curl https://www.opscode.com/chef/install.sh | sudo bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
source ~/.bashrc
nvm install v10.19.0
npm install -g pm2
@sontt9
sontt9 / better-nodejs-require-paths.md
Created July 29, 2019 07:51 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@sontt9
sontt9 / color256.json
Created January 31, 2019 03:47
Color256
[
{
"colorId": 0,
"hexString": "#000000",
"rgb": {"r": 0, "g": 0, "b": 0},
"hsl": {"h": 0, "s": 0, "l": 0},
"name": "Black"
},
{
"colorId": 1,

Keybase proof

I hereby claim:

  • I am sontt9 on github.
  • I am sontt9 (https://keybase.io/sontt9) on keybase.
  • I have a public key whose fingerprint is 7592 E51C 6FF2 998A 769C 1DF8 CECC 88C5 6081 A27D

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am sontt9 on github.
  • I am sontt9 (https://keybase.io/sontt9) on keybase.
  • I have a public key whose fingerprint is 5363 4655 6FF8 10BF EAD3 6360 F8FF 17FE 90BC 5755

To claim this, I am signing this object: