Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active May 6, 2024 11:47
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@normanmaurer
normanmaurer / Http3Server.java
Created December 1, 2020 09:28
Http3Server on top of netty
/*
* Copyright 2020 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@crdrost
crdrost / syncify-example.js
Last active June 2, 2016 17:47
In ES6, async code can already be written synchronously with generators and yield -- no need to wait for ES7's async and await.
"use strict";
/* This is mostly just an example workflow to illustrate how a combination of ES6 generators and promises
* fully allow you to write your asynchronous workflow in a single synchronous-looking block.
*
* Unlike most such workflows which give you a really short snippet that can hide all of the thornier
* problems, this one is approximated from some of my work at IntegriShield: this is all of the real
* stuff that an actual daemon might have to do: manage a queue or three of concurrent workloads; load
* each item of each queue in order; make a bunch of concurrent requests on each item; preprocess each
* of these requests; save preprocessed results to a cache in the database; if all of them have completed
* successfully, report success, or else report failure.

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
@paullewis
paullewis / requestIdleCallback.js
Last active February 21, 2024 16:56
Shims rIC in case a browser doesn't support it.
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
.PHONY: me\ a\ sandwich
me\ a\ sandwich:
@echo "What? Make it yourself"
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@liquidgecka
liquidgecka / cron_helper.sh
Last active September 28, 2023 15:35
Cron helper
#!/bin/bash
usage() {
cat << EOF
Usage: $0 [OPTION]... COMMAND
Execute the given command in a way that works safely with cron. This should
typically be used inside of a cron job definition like so:
* * * * * $(which "$0") [OPTION]... COMMAND
Arguments:
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@willurd
willurd / web-servers.md
Last active May 6, 2024 13:43
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000