Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active March 28, 2024 21:09
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@tykurtz
tykurtz / grokking_to_leetcode.md
Last active March 28, 2024 21:09
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@fragaLY
fragaLY / application.yml
Created December 6, 2021 08:40
The hapi fhir jpa server configuration
server:
port: 8080
shutdown: graceful
undertow:
threads:
worker: 24
io: 3
error:
whitelabel:
enabled: false
@d7samurai
d7samurai / .readme.md
Last active March 28, 2024 21:07
Minimal D3D11 sprite renderer NEO

sponsored by SuperNeo copy 4

Minimal D3D11 sprite renderer NEO

Ultra-compact sprite rendering code with example frame animation logic. This release contains tech bits from the upcoming SuperNeo™ 2D game engine and includes rotation, anchor/pivot point, color filtering, alpha blending and built-in antialiased point sampling. As usual: complete, runnable single-function app. ~150 LOC. No modern C++, OOP or (other) obscuring cruft.

Minimal D3D11 sprite renderer NEO 1337

Sprites are rendered back-to-front (AKA "painter's algorithm") in the order they are submitted, as one draw call. The provided setup employs a single texture atlas containing all the sprite graphics.

The renderer is "im

@streetturtle
streetturtle / sp
Last active March 28, 2024 21:06 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@sindresorhus
sindresorhus / esm-package.md
Last active March 28, 2024 21:06
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Khaadahmed
Khaadahmed / index.html
Created March 28, 2024 21:03
Responsive Dashboard | Chart.js
<body>
<nav class="main-menu">
<div>
<div class="user-info">
<img
src="https://github.com/ecemgo/mini-samples-great-tricks/assets/13468728/e5a707f4-d5ac-4f30-afd8-4961ae353dbc"
alt="user" />
<p>Mia Taylor</p>
</div>
<ul>
@gabe565
gabe565 / change-arc-icon.md
Last active March 28, 2024 21:02
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy

A good way to think about a buffer or an image descriptor is to imagine it as a very fat pointer. This is, in fact, not too far removed from reality, as we shall see.

Taking a peek at radv, we find the uniform buffer and storage buffer descriptors to be a 4-word tuple, where the first two words make up the address, followed by length in bytes for bounds checking and an extra word, which holds format information and bounds checking behavior [^1].

Similarly, the sampled image descriptor is a 16-word tuple containing an