Skip to content

Instantly share code, notes, and snippets.

View mamokin's full-sized avatar
πŸ’­
😺🎢

Michael C. Seaward mamokin

πŸ’­
😺🎢
View GitHub Profile
@mamokin
mamokin / create-grpc-rxjs-project.sh
Created November 26, 2024 18:08
put where you want the project files -> make it executable: `chmod +x create-grpc-rxjs-project.sh` -> run: `./create-grpc-rxjs-project.sh`
#!/bin/bash
# Exit on any error
set -e
echo "Creating gRPC RxJS Demo Project..."
# Initialize git and npm
echo "Initializing git and npm..."
git init
@mamokin
mamokin / πŸ’­.md
Created March 19, 2020 18:40
πŸ’­π•‹π•™π•–π• π•£π•ͺ

Theory

drawing

Guides

Examples

Theory
@mamokin
mamokin / reactjs-apps.md
Last active March 19, 2020 18:37
πŸš€ ℝ𝕖𝕒𝕔π•₯.𝕛𝕀: Apps

React.js Apps

drawing

Guides

Examples

Theory
@mamokin
mamokin / Keno.js
Created March 19, 2020 13:59
πŸš€ React.js: Keno Prototype
import React, { useState, useEffect } from "react";
import "./styles.css";
import { Chance } from "chance";
const chance = new Chance();
/*
Keno cards have 8 rows of numbers with 10 numbers in each row.
Each row starts from the value of the last row + 1
*/
@mamokin
mamokin / rotate-left__n-times.js
Created March 18, 2020 22:13
🧠 π•π•Š: Rotate Left `n` Times
/**
* Rotate each array item left `d` times.
* @param {array} a - Input array
* @param {number} d - Number of places to rotate each item in array left
*/
function rotLeft(a, d) {
let clone = a.slice(0);
// check empty
if(a.length < 2) return clone;
@mamokin
mamokin / settings.json
Created March 17, 2020 12:11
πŸ§™β€β™‚οΈ π”Ύπ•¦π•šπ••π•–: Remove italic comments in VScode
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"comment.line",
"constant",
@mamokin
mamokin / GraphB-D_FS.js
Last active March 17, 2020 12:20
🧠 π•π•Š: Graph class with breadth & depth traversal methods. Queue class included πŸ±β€πŸ‘€
// Breadth & Depth First search
/*
Example diagram: depth 1 indexed first, then 2, then 3, etc.
1. ==> A
/ \
2. ==> B C
/ \ \
3. ==> D E F
Breadth first searches operate on a cluster of nodes from left-to-right:
@mamokin
mamokin / Queue.js
Last active March 17, 2020 12:17
🧠 π•π•Š: Queue Class
class Queue {
constructor() {
this.vertices = [];
}
/**
* Adds a vertex to the queue
* @param {any} vertex - vertex to add to the queue
*/
enqueue(vertex) {
@mamokin
mamokin / GraphDataStructures.md
Last active March 19, 2020 18:38
πŸ’­π•‹π•™π•–π• π•£π•ͺ: Graph Data Structures described

Kinds

A graph is a collection of nodes/vertices and the edges that connect them

Connectivity

  • connected graphs have all vertices connected
    • torrent networks as each vertex offers a portion of the files they share
  • disconnected graphs have some vertices that have no edges connected
  • torrent networks can also be disconnected when a seeder has a file not being shared by any other computer on the network