Skip to content

Instantly share code, notes, and snippets.

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@musab
musab / postgres-cheatsheet.md
Created February 16, 2021 18:16 — 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)
@musab
musab / msg.txt
Created January 18, 2021 19:52
Writing good commit messages
// https://lazau.com/articles/good_commit_messages.html
Short summary of 50 chars or less.
Detailed text which can span multiple paragraphs. Each paragraph
should be line wrapped at 72 chars.
Relevant Links:
- https://myco.atlassian.net/browse/TICKET-32138
@musab
musab / example.js
Created June 9, 2020 19:36
tsdoc example
export class Statistics {
/**
* Returns the average of two numbers.
*
* @remarks
* This method is part of the {@link core-library#Statistics | Statistics subsystem}.
*
* @param x - The first input number
* @param y - The second input number
* @returns The arithmetic mean of `x` and `y`
@musab
musab / kube.md
Last active August 19, 2019 17:37
Kubernetes terminology

Kubernetes terminology:

  1. Pods
  • Group of containers, and is the smallest unit that Kubenetes adminsters. Pods have a single IP address that is applied to every container withiun the pod. ner.
  1. Deployments
  • Define the scale at which you want to run your application by letting you set the details of how you would like the pods replicated on your Kubenertes pods.
  1. Services
  • Kubernetes doesn’t treat its pods as unique, long-running instances; if a pod encounters an issue and dies, it’s Kubernetes’ job to replace it so that the application doesn’t experience any downtime.
@musab
musab / perf.js
Last active February 11, 2019 18:29
view the amount of time a function takes to execute
import { performance } from 'perf_hooks'
const start = performance.now();
doSomething(); // <---- The function you're measuring time for
const end = performance.now();
console.log("Call to doSomething took " + (end - start) + " milliseconds.")
@musab
musab / objectDefault.ts
Created February 5, 2019 14:27
Set default objects with Object.assign
type MenuConfig = {title?: string, body?: string, buttonText?: string, cancellable?: boolean};
function createMenu(config: MenuConfig) {
const menuConfig = Object.assign({
title: 'Foo',
body: 'Bar',
buttonText: 'Baz',
cancellable: true
}, config);
}