Skip to content

Instantly share code, notes, and snippets.

@prestwich
prestwich / monorepo.md
Last active November 25, 2022 17:15
How to break up a monorepo :)

How to break up a monorepo using git subtree:

  1. Set up some basic stuff:
    • These should be independent, not nested
$ NEW_REPO_PATH=
$ OLD_REPO_PATH=
@gagarine
gagarine / fish_install.md
Last active April 29, 2024 19:36
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@akehrer
akehrer / sqlite_to_json.sql
Created January 9, 2018 19:58
SQLite Results as JSON using the SQLite JSON1 extension
-- When SQLite is compiled with the JSON1 extensions it provides builtin tools
-- for manipulating JSON data stored in the database.
-- This is a gist showing SQLite return query data as a JSON object.
-- https://www.sqlite.org/json1.html
-- An example table with some data
CREATE TABLE users (
id INTEGER PRIMARY KEY NOT NULL,
full_name TEXT NOT NULL,
email TEXT NOT NULL,
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 30, 2024 19:19
Semantic Commit Messages

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

@nicowilliams
nicowilliams / fork-is-evil-vfork-is-good-afork-would-be-better.md
Last active November 5, 2023 12:14
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid

I recently happened upon a very interesting implementation of popen() (different API, same idea) called popen-noshell using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

This is not a paper. I assume reader familiarity with fork() in particular and Unix in general, though, of course, I link to relevant wiki pages, so if the unfamiliar reader is willing to go down the rabbit hole, they should be able to come ou

@msrose
msrose / combining-git-repositories.md
Last active April 22, 2024 19:05
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 28, 2024 12:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname