Skip to content

Instantly share code, notes, and snippets.

@faustinoaq
faustinoaq / myAngular.html
Last active March 28, 2025 22:30
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@chockenberry
chockenberry / PrivacyInfo.xcprivacy
Last active April 19, 2024 18:39
PrivacyInfo.xcprivacy sample
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>

Rusty's API Design Manifesto

The idea

Application Programming Interface (API) design is hard. But it's even harder to change once you get it wrong. So what you should do is to spend the effort to get it right the first time around.

In the Linux Kernel community Rusty Russell came up with a API rating scheme to help us determine if our API is sensible, or not. It's a rating from -10 to 10, where 10 is perfect is -10 is hell. Unfortunately there are too many examples at the wrong end of the scale.

Rusty's original descriptions

@jsoncow
jsoncow / unsupported.csv
Created November 5, 2023 13:26
Unsupported AWS Service Quotas
ServiceCode ServiceName QuotaCode QuotaName
AWSCloudMap AWS Cloud Map L-D95E8A57 Instances per namespace
AWSCloudMap AWS Cloud Map L-2DA90E5C Instances per service
AWSCloudMap AWS Cloud Map L-D589BB26 Custom attributes per instance
account AWS Account Management L-E37B66F4 Number of concurrent region-opt requests per account
account AWS Account Management L-33A0F311 Number of concurrent region-opt requests per organization
acm AWS Certificate Manager (ACM) L-DA1D8B98 ACM certificates created in last 365 days
acm AWS Certificate Manager (ACM) L-D2CB7DE9 Imported certificates
acm AWS Certificate Manager (ACM) L-FB94F0B0 Domain names per ACM certificate
acm AWS Certificate Manager (ACM) L-F141DD1D ACM certificates
@MarcoEidinger
MarcoEidinger / findRequiredReasonAPIUsage.sh
Created August 21, 2023 19:55
A shell script to find if any "required reason API" are used in Swift or Objective-C files within that folder or subfolders
#!/bin/bash
# https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api
searchTerms=(
# File timestamp APIs
"creationDate"
"modificationDate"
"fileModificationDate"
"contentModificationDateKey"
"creationDateKey"

Ancient Infrastructure

The community still has access to some sort of functioning ancient infrastructure, whether it's an array of wall-mounted arcane energy projectors, running water, moving roadways, community-wide climate control, or some other inherited luxury. This infrastructure may be the result of a still-functional Working, or it could be the product of some venerable occult engine that's still operational, or it may be the fruit of the labors of some specially-designed organism or Blighted populace. E Abusive ruler overusing the infrastructure, Foreign agent seeking to cause havoc, Reckless sorcerer seeking to steal its power F Harried chief of the maintainers, Fascinated foreign scholar, Merchant reliant on its use C

import random
from statistics import mean
from statistics import median
from statistics import mode
from statistics import stdev
import seaborn as sns
import matplotlib.pyplot as plt
# this function is not really necessary,
# but it makes the gameplay loop easier to read
@kfox
kfox / README.md
Last active December 4, 2023 11:08
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
@hwayne
hwayne / circuit.als
Created February 6, 2023 21:53
Simple example of alloy synthesis
enum Val {On, Off}
sig P {} //"Permutation"
abstract sig Input {
val: Val one -> P
}
sig Source extends Input {}
abstract sig Gate extends Input {
@ilyagr
ilyagr / jj-vim.md
Last active March 6, 2025 21:45
Using Vim as a `jj` difftool with the DirDiff plugin or vimtabdiff.py script

vimdiff comes as a pre-configured merge tool for jj and can be used with jj resolve out of the box. However, the default configuration for vimdiff as a diff editor (for jj split, etc.) is barely useable.

To more conveniently use Vim as a difftool for jj, try one of the following setups:

DirDiff plugin

  1. Install the DirDiff Vim plugin.