Skip to content

Instantly share code, notes, and snippets.

@bcherny
bcherny / designing-data-intensive-application-notes.md
Last active May 5, 2024 19:57
Notes: Designing Data-Intensive Applications

Notes on Martin Kleppmann's excellent Designing Data-Intensive Applications.

Chapter 1: Reliable, Scalable, and Maintainable Applications

  • Data Systems
    • Dimensions to consider when thinking about data systems: access patterns, performance characteristics, implementations.
    • Modern data systems often blur the lines between databases, caches, streams, etc.
  • Reliability
    • Systems should perform the expected function at a given level of performance, and be tolerant to faults and user mistakes
  • Fault: One component of a system deviating from its spec. Prefer tolerating faults over preventing them (except for things like security issues). Faults stem from hardware failures, software failures, and human error (in a study, config errors caused most outages).
@christophengelmayer
christophengelmayer / tailwind-resonsive-embed.html
Last active March 26, 2023 13:42
Tailwind CSS responsive Video embed
<div class="relative" style="padding-top: 56.25%">
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube-nocookie.com/embed/FMrtSHAAPhM" frameborder="0" …></iframe>
</div>
@kanzitelli
kanzitelli / docker-compose.yml
Created September 12, 2019 18:31
Docker Compose file with Traefik, Backend and MongoDB configured. For running locally.
version: '3'
services:
reverse-proxy:
image: traefik:v2.0
container_name: traefik
command: --api --providers.docker
ports:
- "6969:80"
- "6970:8080"
@letsjump
letsjump / librelink.sql
Last active March 20, 2023 02:55
Export Librelink android app data to excel (no need to root your phone)
@bcherny
bcherny / options-in-typescript.ts
Last active February 25, 2023 23:57
Options in TypeScript
type None = {
flatMap<U>(f: (value: null) => Option<U>): None
getOrElse<U>(def: U): U
isEmpty(): true
map<U>(f: (value: null) => U): None
nonEmpty(): false
orElse<U>(alternative: Option<U>): Option<U>
}
type Some<T> = {
@erikras
erikras / RichTextMarkdown.js
Created October 28, 2016 12:23
Using react-rte with redux-form
import React, { Component, PropTypes } from 'react'
class RichTextMarkdown extends Component {
static propTypes = {
input: PropTypes.shape({
onChange: PropTypes.func.isRequired,
value: PropTypes.string
}).isRequired
}
@darklight721
darklight721 / INSTRUCTIONS.md
Last active December 7, 2020 12:57
Using MobX with decorators in React Native

Using MobX with decorators in React Native

The following instructions should work with React Native v0.32:

  1. Install mobx libraries.

    npm install mobx --save
    npm install mobx-react --save
@joostvanveen
joostvanveen / du.sh
Last active March 16, 2023 05:44
Get folder sizes on command line, including --max-depth, sorted by folder size desc
# Get available disk space
df -h
# Get the top 10 biggest folders in the current directory
du -h --max-depth=1 | sort -rh | head -10
# Get the top 10 biggest folders in the current directory and their first child directories
du -h --max-depth=2 | sort -rh | head -10
# Get sizes of all folders in the current directory
@gorangajic
gorangajic / es6-spread-immutable-cheatsheet.md
Last active April 11, 2024 08:32
es6 spread immutable cheatsheet

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {
@tobiasstrebitzer
tobiasstrebitzer / bower.json
Created June 30, 2015 03:24
Polymer 1.0 Global Variables Behavior
{
"name": "polymer-globals-behavior",
"dependencies": {
"polymer": "Polymer/polymer#~1.0.5"
}
}