Skip to content

Instantly share code, notes, and snippets.

I like Kotlin

Nicola Zanon zanonnicola

I like Kotlin
View GitHub Profile
mcollina /
Last active Jul 6, 2022
Matteo's Technical principles

Matteo Technical Principles

1. Conway’s Law is paramount.

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.

In order to design a piece of software we need to “design” the team that is going to produce it.

2. Developer Experience is key to productivity

DavidWells / javascript-proxy-as-rest-client.js
Last active Aug 7, 2022
Using a javascript proxy as low code REST client
View javascript-proxy-as-rest-client.js
/* Using a JavaScript proxy for a super low code REST client */
// via
// also see
// also see
// also see
// and
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
ClickerMonkey / types.ts
Last active May 25, 2022
Typescript Helper Types
View types.ts
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]
slikts /
Last active Nov 2, 2022
Advanced memoization and effects in React

Advanced memoization and effects in React

Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo() do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.

Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over:

  • Memoization means caching the output based on the input; in the case of functions, it means caching the return value based on the arguments.
  • Values and references are unfortunately overloaded terms that can refer to the low-level implementation details of assignments in a language like C++, for example, or to memory
zmts /
Last active Dec 4, 2022
Docker, TypeScript, Node.js

Docker, TypeScript, Node.js


  • TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
LayZeeDK / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Last active Dec 9, 2022
Angular CLI, Angular, Node.js, TypeScript, and RxJS version 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 both major and minor TypeScript versions contain breaking changes.
View angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Angular CLI version Angular version Node.js version TypeScript version RxJS version
1.0.0-beta.17 (package name: angular-cli) ~2.0.2 ^6.9.5 ~2.0.10 ^5.0.3
1.0.0-beta.20-1 (package name: angular-cli) ~2.1.2 ^6.9.5 ~2.0.10 ^5.0.3
1.0.0-beta.22-1 (package name: angular-cli) ~2.2.4 ^6.9.5 ~2.0.10 ^5.0.3
1.0.0-beta.30 ~2.3.1 ^6.9.5 ~2.0.10 ^5.0.3
1.0.0-rc.4 ~2.4.10 ^6.9.5 ~2.0.10 ^5.0.3
~1.0.6 >= 4.0.3 <= 4.1.3 ^6.9.5 ~2.2.2 ^5.0.3
~1.1.3 >= 4.0.3 <= 4.1.3 ^6.9.5 ~2.3.4 ^5.0.3
~1.2.7 >= 4.0.3 <= 4.1.3 ^6.9.5 ~2.3.4 ^5.0.3
~1.3.2 >= 4.2.6 <= 4.4.7 ^6.9.5 ~2.4.2 ^5.0.3
LayZeeDK / web-application-horizontal-layers.csv
Last active Aug 12, 2022
Horizontal layers of a web application.
View web-application-horizontal-layers.csv
Horizontal layer Examples
Business logic Application-specific logic, domain logic, validation rules
Persistence WebStorage, IndexedDB, WebSQL, HTTP, WebSocket, GraphQL, Firebase, Meteor
Messaging WebRTC, WebSocket, Push API, Server-Sent Events
I/O Web Bluetooth, WebUSB, NFC, camera, microphone, proximity sensor, ambient light sensor
Presentation DOM manipulation, event listeners, formatting
User interaction UI behaviour, form validation
State management Application state management, application-specific events
cecilemuller /
Last active Dec 8, 2022
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

kentcdodds / with-foo.js
Created Nov 15, 2017
Which of these is a higher order component?
View with-foo.js
// Which of these things is the "Higher Order Component?"
function withFoo(Component) { // <-- this is a function, not a component
class Wrapper extends React.Component { // <-- this is a component
static displayName = `withFoo(${Component.displayName ||})`
static propTypes = {innerRef: PropTypes.func}
static WrappedComponent = Component
render() {
const {innerRef, ...remainingProps} = this.props
return <Component {...remainingProps} foo="FOO!" ref={innerRef} />