Skip to content

Instantly share code, notes, and snippets.

View apappas1129's full-sized avatar

Alexandros Pappas apappas1129

View GitHub Profile
@felixeichler
felixeichler / levenshtein.ts
Last active October 9, 2024 10:38 — forked from andrei-m/levenshtein.js
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/**
* Computes the Levenshtein distance between two strings (a number that tells you how different two strings are).
* The higher the number, the more different the two strings are.
* Original source: https://gist.github.com/andrei-m/982927/0efdf215b00e5d34c90fdc354639f87ddc3bd0a5
*/
const getLevenshteinDistance = (a: string, b: string): number => {
if (a.length == 0) return b.length;
if (b.length == 0) return a.length;
const matrix = [];
@apappas1129
apappas1129 / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Created December 6, 2021 00:34 — forked from LayZeeDK/angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Angular CLI, Angular, Node.js, TypeScript, and RxJS compatibility matrix. Based on changelogs, metadata, and hands-on experience. Major Node.js and RxJS versions above officially supported versions are not listed. Note that minor TypeScript versions also contain breaking changes.
Angular CLI version Angular version Node.js version TypeScript version RxJS version
1.0.0-beta.17 (package name: angular-cli) 2.0.x 6.9.x or later minor version 2.0.x 5.0.x or later minor version
1.0.0-beta.20-1 (package name: angular-cli) 2.1.x 6.9.x or later minor version 2.0.x 5.0.x or later minor version
1.0.0-beta.22-1 (package name: angular-cli) 2.2.x 6.9.x or later minor version 2.0.x 5.0.x or later minor version
1.0.0-beta.30 2.3.x 6.9.x or later minor version 2.0.x 5.0.x or later minor version
1.0.0-rc.4 2.4.x 6.9.x or later minor version 2.0.x 5.0.x or later minor version
1.0.6 4.0.x/4.1.x 6.9.x or later minor version 2.2.x 5.0.x or later minor version
1.1.3 4.0.x/4.1.x 6.9.x or later minor version 2.3.x 5.0.x or later minor version
1.2.7 4.0.x/4.1.x 6.9.x or later minor version 2.3.x 5.0.x or later minor version
1.3.2 4.2.x/4.3.x/4.4.x 6.9.x or later minor version 2.4.x 5.0.x or later minor version
import { BehaviorSubject, Subject, combineLatest } from 'rxjs'
import { useState, useEffect } from 'react'
import { skip, filter } from 'rxjs/operators'
export const useSharedState = <T>(
defaultState: T,
subject: Subject<T>
): [T, typeof useState] => {
const [value, setState] = useState(defaultState)
useEffect(() => {
@LayZeeDK
LayZeeDK / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Last active April 12, 2025 10:40
Angular CLI, Angular, Node.js, TypeScript, and RxJS version compatibility matrix. Officially part of the Angular documentation as of 2023-04-19 https://angular.io/guide/versions
Angular CLI version Angular version Node.js version TypeScript version RxJS version
~16.0.0 ~16.0.0 ^16.13.0 || ^18.10.0 >=4.9.5 <5.1.0 ^6.5.5 || ^7.4.0
~15.2.0 ~15.2.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.1.0 ~15.1.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.0.5 ~15.0.4 ^14.20.0 || ^16.13.0 || ^18.10.0 ~4.8.4 ^6.5.5 || ^7.4.0
~14.3.0 ~14.3.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.2.0 ~14.2.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.1.3 ~14.1.3 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~14.0.7 ~14.0.7 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~13.3.0 ~13.3.0 ^12.20.2 || ^14.15.0 || ^16.10.0 >=4.4.4 <4.7.0 ^6.5.5 || ^7.4.0
@bradtraversy
bradtraversy / ssh.md
Last active April 19, 2025 10:05
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh [email protected]

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@stereokai
stereokai / index.css
Created June 18, 2017 11:03
Trigonometry in CSS
//----------------------------------*\
// TRIGONOMETRY FUNCTIONS
//----------------------------------*/
// # Trigonometry in CSS
//
// - Through Taylor/Maclaurin polynomial representation: http://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf
// - Useful if you don't want to use JS.
// - With CSS Variables.
// - `calc()` can't do power (x ^ y) so I used multiplication instead.
@peduarte
peduarte / esnextbin.md
Last active August 25, 2022 14:55
Vanilla Debounce
@bsara
bsara / git-ssh-auth-win-setup.md
Last active April 24, 2025 05:04
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active April 24, 2025 13:30
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line