Skip to content

Instantly share code, notes, and snippets.

View tonyhb's full-sized avatar
🕳️
void

Tony Holdstock-Brown tonyhb

🕳️
void
View GitHub Profile
@jakubriedl
jakubriedl / batchFetchExchange.ts
Last active June 10, 2023 04:13
URQL batchFetchExchange
import DataLoader from 'dataloader'
import { Exchange, Operation } from 'urql'
import { pipe, map } from 'wonka'
interface BatchRequest {
url: string
options?: RequestInit
}
const batchFetch = (
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active April 26, 2024 00:57
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@molsches
molsches / gist:32fcec2499e95b5b23bc268800e22780
Last active November 28, 2018 15:55
Sample Note for AWS Comprehend Medical
ROS (10 systems)
In addition to that documented in the HPI above, the additional ROS was obtained:
Constitutional: Denies fevers or chills
Eyes: Denies vision changes
ENMT: Denies sore throat
CV: Denies chest pain
Resp: Denies SOB
GI: Denies vomiting or diarrhea
GU: Denies painful urination
MSK: Denies recent trauma
@arkadiyt
arkadiyt / cryptopals_set_8.md
Last active April 25, 2023 11:19
Cryptopals Set 8

Cryptopals is a set of cryptographic challenges, originally published here: https://cryptopals.com

Set 8 of the challenges was never published publicly, until late March 2018. However the cryptopals website was not updated to include the challenges. This gist compiles the 8th set of the Cryptopals challenges.

title link
57. Diffie-Hellman Revisited: Small Subgroup Confinement https://toadstyle.org/cryptopals/513b590b41d19eff3a0aa028023349fd.txt
58. Pollard's Method for Catching Kangaroos https://toadstyle.org/cryptopals/3e17c7b35fcf491d08c989081ed18c9a.txt
59. Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks https://toadstyle.org/cryptopals/a0833e607878a80fdc0808f889c721b1.txt
@kvark
kvark / rust-graphics.md
Created September 9, 2017 02:58
Rust Graphics Libraries Navigator

What sort of graphics do you need?

  • 2D only. All you need is...
  • 3D for sure. Do you like making your hands dirty?
  • Sometimes: amethyst
@Keenuts
Keenuts / readme.md
Last active November 14, 2023 13:34
GSoC 2017 | Virgl Windows Driver

GSOC 2017 | Virgl Windows Driver

Project links

The project is split into several parts:

  • The kernel driver, with simple 3D command forwarding and 3D resource allocation
  • The userland driver, in fact the OpenGL backend
  • The reference, explaining virtio-gpu commands

https://github.com/Keenuts/virtio-gpu-win-icd \

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@alecjacobson
alecjacobson / viewmesh.cpp
Last active January 11, 2019 07:40
Command line program to view 3D meshes from files, standard input and pipes
#include <igl/guess_extension.h>
#include <igl/read_triangle_mesh.h>
#include <igl/viewer/Viewer.h>
#include <Eigen/Core>
#include <iostream>
#include <string>
#include <cstdio>
#include <unistd.h>
int main(int argc, char * argv[])

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?