Skip to content

Instantly share code, notes, and snippets.

View nxpatterns's full-sized avatar
🍀
I will always be polite to you, even if you're not; you can at most be blocked.

Enterprise Software Architecture nxpatterns

🍀
I will always be polite to you, even if you're not; you can at most be blocked.
View GitHub Profile
@nxpatterns
nxpatterns / close-that-stream-if-no-need.ts
Created January 26, 2022 07:49 — forked from LironHazan/close-that-stream-if-no-need.ts
Irena's stop fetching recipe - for rxjs blog post
private unsubscribeDataFetch: Subject<void> = new Subject<void>();
// polling data till we get what we need and stop
fetchData() {
this.dataService
.pipe(takeUntil(this.unsubscribeDataFetch))
.subscribe((data) => actOnData(data));
}
actOnData(data) {

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@nxpatterns
nxpatterns / main.go
Created May 21, 2021 20:38 — forked from filewalkwithme/main.go
Listening multiple ports on golang http servers (using http.Handler)
package main
import (
"net/http"
)
func main() {
go func() {
http.ListenAndServe(":8001", &fooHandler{})
}()
@nxpatterns
nxpatterns / .zshrc
Created January 13, 2021 15:37
Enhance your terminal with zsh and Prezto
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
@nxpatterns
nxpatterns / whitelist.md
Created November 26, 2020 21:13 — forked from kivikakk/whitelist.md
HTML sanitizer whitelist for user content on GitHub.com
  • Any allowed id and name attributes have "user-content-" prefixed to their value.
  • A maximum of 2 nested sub or sup tags are allowed.
  • A maximum of 10 nested ul or ol tags are allowed.
Allowed Element Allowed Attributes
All allowed elements abbr, accept, accept-charset, accesskey, action, align, alt, axis, border, cellpadding, cellspacing, char, charoff, charset, checked, clear, color, cols, colspan, compact, coords, datetime, dir, disabled, enctype, for, frame, headers, height, hreflang, hspace, id, ismap, itemprop, label, lang, maxlength, media, method, multiple, name, nohref, noshade, nowrap, open, prompt, readonly, rev, rows, rowspan, rules, scope, selected, shape, size, span, start, summary, tabindex, title, type, usemap, valign, value, vspace, width
a As above plus href (must be github-mac, github-windows, http,
@nxpatterns
nxpatterns / CouchDB_Python.md
Created November 12, 2020 19:25 — forked from marians/CouchDB_Python.md
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@nxpatterns
nxpatterns / introrx.md
Created November 7, 2020 16:42 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@nxpatterns
nxpatterns / csv.pegjs
Created July 26, 2020 15:23 — forked from trevordixon/csv.pegjs
Javascript CSV Parser generated by PEG.js
{
var separator = ',';
}
start
= comma
comma
= & { return separator = ','; } sv:sv { return sv; }
@nxpatterns
nxpatterns / Observable_in_vanillaJS.md
Created December 15, 2019 19:26 — forked from ltciro/Observable_in_vanillaJS.md
simulate pattern observable in vanilla JS

Rxjs

const next = (message)=> console.log("First observer message: " + message);
const error = (error) => console.log("Second observer error: " + error);
const complete = () => console.log("complete");

const next1 = (message)=> console.log("First observer message 1: " + message);
const error1 = (error) => console.log("Second observer error 1: " + error);
const complete1 = () => console.log("complete 1");
@nxpatterns
nxpatterns / README.md
Created July 20, 2018 17:05 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
  • List every object at each commit.