Skip to content

Instantly share code, notes, and snippets.

View kaayce's full-sized avatar
🖤
Based

Patrick Nzediegwu kaayce

🖤
Based
View GitHub Profile
@kaayce
kaayce / exercise.tour.go
Created October 31, 2024 22:30 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@kaayce
kaayce / docker.md
Created June 27, 2024 16:50
Docker Cheat Sheet
# Docker CLI Cheat Sheet

# Images

## Build an Image from a Dockerfile
```sh
docker build -t <image_name> .
@kaayce
kaayce / MakeFile
Last active June 27, 2024 16:41
Docker MakeFIle template
##################################### VARIABLES #################################
#Get the current directory of this Makefile as it may be included in other Makefiles
#http://stackoverflow.com/questions/18136918/how-to-get-current-directory-of-your-makefile
PSQL_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PSQL_DIR := $(abspath $(patsubst %/,%,$(dir $(PSQL_PATH))))
#Get the path to the top most Makefile, or wherever this command was invoked from
TOP_PATH := $(shell pwd)

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@kaayce
kaayce / 55-bytes-of-css.md
Created September 26, 2022 18:44 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@kaayce
kaayce / tsconfig.json
Created May 19, 2022 02:45
Basic TSConfig for NextJS
{
"compilerOptions": {
/* Basic Options */
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": [ /* Specify library files to be included in the compilation. */
"es6",
"es7",
"esnext",
"dom"
@kaayce
kaayce / prepare-commit-msg.sh
Created March 4, 2022 19:17 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@kaayce
kaayce / regex.txt
Created March 3, 2022 07:10
Regex Cheatsheet
. - Any Character Except New Line
\d - Digit (0-9)
\D - Not a Digit (0-9)
\w - Word Character (a-z, A-Z, 0-9, _)
\W - Not a Word Character
\s - Whitespace (space, tab, newline)
\S - Not Whitespace (space, tab, newline)
\b - Word Boundary
\B - Not a Word Boundary