Skip to content

Instantly share code, notes, and snippets.

View jpatrickdill's full-sized avatar

Patrick Dill jpatrickdill

View GitHub Profile
@wbolster
wbolster / stacked_decorator.py
Last active January 7, 2023 18:06
python joke code abusing the @ operator to ‘extend’ decorator syntax
"""
This is joke^Wenterprise code ab^H^Husing the ‘@’ operator to simulate
applying multiple decorators on a single line of code.
"""
# © 2022 wouter bolsterlee, licensed under SPDX BSD-3-Clause
import functools
# helper class and the magic ‘@stacked’ decorator itself
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active February 19, 2024 21:55
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');