Skip to content

Instantly share code, notes, and snippets.

View bennidi's full-sized avatar

Benjamin Diedrichsen bennidi

View GitHub Profile
@bennidi
bennidi / Aliases-On-Linux.md
Created February 24, 2022 08:40
Awesome Fish|Bash
@bennidi
bennidi / Generic-Types-And-Functions.md
Created February 24, 2022 08:35
Typescript Demystified

Functions can have properties, that's what the object literal syntax is for: it allows to define a call signature and additional properties. Your two examples are equivalent because the second doesn't define additional properties on the object literal. You can read more on that in the section on hybrid types.

Additionally, the object literal allows to define multiple call signatures for function overloads. You can create an object of such an interface with Object.assign:`

interface Foo {
    (x: string): number,
    (x: number): string,
    bar: Array<any>,
@bennidi
bennidi / ranger-cheatsheet.md
Created February 22, 2022 11:45 — forked from heroheman/ranger-cheatsheet.md
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@bennidi
bennidi / multistream.js
Created September 13, 2018 17:14
Node.js: Composing multiple streams into one
import string_stream from 'string-to-stream'
import multi_stream from 'multistream'
ctx.status = 200
ctx.body = multi_stream
([
string_stream(before_content),
typeof content === 'string' ? string_stream(content) : content,
string_stream(after_content)
])
@bennidi
bennidi / gist:3b6e39c5a0ce225cb391332d9128fcc7
Created April 17, 2018 10:21 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@bennidi
bennidi / CODE-SMELLS.md
Last active February 24, 2022 08:44
Snippets with different design smells to learn from

A collection of examples for typcial code smells taken from real world examples...