You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🇵🇸
Mohammad Al Zouabi
aboqasem
🇵🇸
An enthusiastic software engineer eager to contribute to a better world.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.
Here's how I combine the two, to create docs with embedded diagrams.
Step 0: Setup
Get the command-line PlantUML from the download page or your relevant package manager.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example: Moving up to a few commits to another branch
Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.
cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated
git checkout branch-B
git cherry-pick X
git cherry-pick Y
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.
FuturesB.java Example of using Futures for nested calls showing how it blocks inefficiently.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters