Skip to content

Instantly share code, notes, and snippets.

@musab
musab / rewriting-git-history.md
Created July 25, 2023 03:54 — forked from cerebrl/rewriting-git-history.md
Understand how rewriting history with `git amend` and `git rebase` can be crucial in keeping your Git logs clean and simple, while avoiding some dangerous consequences.

Rewriting Git History

Say you have a code base that you just created and you have two commits locally:

commit a
commit b

This is your “version history”. You then push these commits to your remote. Now you have two repos with the same history:

@musab
musab / management.md
Created July 3, 2023 08:22 — forked from samlambert/management.md
Management @ PlanetScale

We want PlanetScale to be the best place to work. But every company says that, and very few deliver. Managers have a role in creating an amazing work experience, but things go awry when the wrong dynamic creeps in.

We have all seen those managers who collect people as “resources” or who control information as a way to gain “power.” In these cultures, people who “can’t” end up leading the charge. This is management mediocrity.

What will make us different? At PlanetScale, we won’t tolerate management mediocrity. We are building a culture where politics get you nowhere and impact gets you far. Managers are here to support people who get things done. They are as accountable to their team as their team is accountable to them.

We evaluate managers on the wellbeing and output of their team, how skillfully they collaborate with and influence others, and how inclusively and transparently they work.

You can expect your manager to:

  • Perceive a better version of you and support you in getting there
@musab
musab / new-note.sh
Last active May 9, 2023 01:30
bash script to quickly create a new new
create_note() {
# Get the current date in the format YYYY-MM-DD
local date=$(date +%Y-%m-%d)
# Generate the file path
local filepath="/Documents/notes/${date}-${1}.md"
# Create the file
touch "$filepath"
}
@musab
musab / front-matter.md
Created March 29, 2023 05:51
what is front matter?

Markdown front matter refers to a block of metadata at the beginning of a Markdown file, usually written in YAML or JSON format. Front matter provides a way to store additional information about the content, such as title, author, date, tags, and other custom attributes.

What is the goal:

As a type of user/persona, I want to perform some task, so that I can achieve some goal/benefit/value.

Details:

Enter any details, clarifications, answers to questions, or points about implementation here.

Dev Notes:

@musab
musab / gomock.md
Created November 14, 2022 19:14 — forked from thiagozs/gomock.md
Tutorial gomock

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.

version: 2
jobs:
publish:
docker:
- image: <docker-image-name-tag>
auth:
username: mydockerhub-user
password: mypassword123
steps:
@musab
musab / interface_and_di.go
Last active March 25, 2022 17:23
Go Interfaces and Dependency Injection for Testing
// you can play with the code via https://go.dev/play/p/bVfCe51O0en
package main
import "fmt"
// src/add.go
type Adder interface {
add(int, int) int
@musab
musab / docker.md
Created January 20, 2022 14:00
docker commands cheatsheet

Run a docker image

docker run nginx

Run a specific tag of a docker image

docker run redis:4.0

List all running containers

TZ='UTC'
NODE_ENV=development
PORT=8000
API_TOKEN=c03ec4d8-3cbe-43ff-98f8-f010cb5cb45e
MIGRATION_DB_HOST=localhost
MIGRATION_DB_PORT=5432
MIGRATION_DB_name=noted
MIGRATION_DB_USER=postgres
MIGRATION_DB_PASS=B3Th3B3st
DATABASE_URL='postgres://postgres:B3Th3B3st@localhost/notes'