Skip to content

Instantly share code, notes, and snippets.

View petergi's full-sized avatar
💭
Just Busy Living On The Side Of A Square

Peter Giannopoulos petergi

💭
Just Busy Living On The Side Of A Square
View GitHub Profile
function graphTopoSort(numberNodes, edges) {
const nodes = new Map();
const order = [];
const queue = [];
for (let i = 0; i < numberNodes; i++) {
nodes.set(i, { in: 0, out: new Set() });
}
edges.forEach(edge => {
const [node_id, pre_id] = edge;
function deepEqual(val1, val2) {
if (typeof val1 !== typeof val2) {
return false;
}
// Array comparison.
if (Array.isArray(val1) && Array.isArray(val2)) {
if (val1.length !== val2.length) {
return false;
# Color Thesaurus
## Yellow Color Names
Mellow yellow, Cyber yellow, Royal yellow, Banana yellow, Tuscany yellow, Lemon yellow, Bumblebee yellow, Cream yellow, Peach yellow, Laguna yellow, Mustard yellow, Corn yellow, Pineapple yellow, Flaxen yellow, Eggnog yellow, Trombone yellow, Flax yellow, Ecru yellow, Sepia yellow
## Orange Color Names
Gold orange, Goldenrod orange, Pumpkin orange, Fire orange, Ochre orange, Burnt orange, Dijon orange, Tangerine orange, Tiger orange, Honey orange, Carrot orange, Amber orange, Apricot orange, Bronze orange, Cider orange, Clay orange, Rust orange, Amber orange, Spice orange.

Git Cherry Pick

git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD. Cherry picking is the act of picking a commit from a branch and applying it to another. git cherry-pick can be useful for undoing changes. For example, say a commit is accidently made to the wrong branch. You can switch to the correct branch and cherry-pick the commit to where it should belong.

When to use git cherry pick

git cherry-pick is a useful tool but not always a best practice. Cherry picking can cause duplicate commits and many scenarios where cherry picking would work, traditional merges are preferred instead. With that said git cherry-pick is a handy tool for a few scenarios...

REGEX cheatsheet

Character classes

. Any character, except newline
\c Control Character
\w Word
\d Digit
\x Hexadecimal Digit
mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisation
        British popular psychology author Tony Buzan
    Research
 On effectivenessand features
gitGraph
	    commit
    	commit
	    branch develop
    	checkout develop
	    commit
	    commit
	    checkout main
 merge develop
classDiagram
    note "From Duck till Zebra"
    Animal <|-- Duck
    note for Duck "can fly
    can swim
    can dive
    can help in debugging"
    Animal <|-- Fish
 Animal &lt;|-- Zebra
flowchart LR

A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
erDiagram
  USERS ||--o{ USER_ROLES : assigns
  USERS ||--o{ PROJECTS : owns
  USERS ||--o{ TASKS : assigned
  USERS ||--o{ AUDIT_LOGS : acts
  ROLES ||--o{ USER_ROLES : grants
  PROJECTS ||--o{ TASKS : contains
  PROJECTS ||--o{ PROJECT_VIEWS : configures
  PROJECTS ||--o{ AUTOMATION_FLOWS : drives