Skip to content

Instantly share code, notes, and snippets.

View dmgolembiowski's full-sized avatar

David M. Golembiowski dmgolembiowski

View GitHub Profile
@vi
vi / Cargo.toml
Created December 18, 2022 20:14
Rust async executor abuse to avoid both blocking and threads (v2)
[package]
name = "hackyws"
version = "0.1.1"
edition = "2021"
[dependencies]
anyhow = "1.0.66"
async-tungstenite = "0.18.0"
flume = "0.10.14"
@vi
vi / Cargo.toml
Last active June 19, 2023 20:03
Rust async executor abuse to avoid both blocking and threads
[package]
name = "hackyws"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1.0.66"
async-executor = "1.5.0"
async-tungstenite = "0.18.0"
To From Method
string of code literal code std::stringify!{}
string of code syntax tree !quote(#syntax_tree).to_string()
string of code TokenStream .to_string()
string of syntax literal code format!("{:?}",parse2::<SynType>(quote! {...}).expect(...)
string of syntax syntax tree format!("{:?}"),…), format!("{:#?}"),…)
string of tokens literal code format!("{:?}",quote! {...})
string of tokens TokenStream format!("{:?}"),…), format!("{:#?}"),…)
syn::Error TokenStream .to_compile_error() [see Rule #7]
syntax tree literal code parse_quote!(…)
@lauslim12
lauslim12 / raspberry-development-server.md
Last active August 30, 2022 15:31
Set up your personal development server in your network with a Raspberry Pi!

Raspberry Development Server

This note is made to provide knowledge on how to set up your own Raspberry Pi for personal development on your own Wi-Fi network. It does not necessarily have to be a Raspberry Pi, you can do it with any server / instance on Cloud as well (EC2, Compute Engine, Droplets, and the like).

As this is made for development, this is not suitable for production environments due to performance, security, and efficiency issues. Please adjust accordingly if you want to use this in production environments.

Specifications

Personally, I am using a Raspberry Pi 4. It is equipped with 8GB RAM and I installed a 64GB MicroSD on it to act as its storage. My Raspberry Pi has the following software specifications:

@pfrazee
pfrazee / schemas-design-doc-draft.md
Created June 8, 2022 20:22
An initial draft proposal of record schemas for Bluesky's ADX project.

Schemas Design Doc (draft)

Please note: The following document is an initial draft proposal. All decisions are subject to change. Our present goal is to collect feedback and iterate upon this document. Please feel free to share your suggestions and concerns.

Overview

ADX is a federated network for distributing data. It leverages cryptographic signatures and hashes to distribute authenticity proofs along with the data, enabling each node to transact upon the data independently of the data's origin. ADX might therefore be described as an Internet-native database in which records are replicated across nodes.

As a consequence of relying on authenticity proofs, ADX must exchange "canonical" records. That is, ADX records must be transmitted in their original encoding and structure in order to validate the signatures and hashes which comprise the proofs. This stands in contrast to the RESTful model of the Web in which "representations" of records are exchanged and therefore may be constructed at the ti

@icedterminal
icedterminal / about.md
Last active April 2, 2024 06:28
Jellyfin + NGINX

Jellyfin + NGINX

Reference configuration files for using Jellyfin with NGINX.

https://docs.icedterminal.com/en/linux/jellyfin

  • Last updated: 2nd January, 2024
  • Supports NGINX mainline releases with OpenSSL 3+. The minimum required verison is 1.25.1.

Notes

The config files are used with my own custom build of NGINX. Things you will not have access to with a vanilla build (mainline) are commented out. This being Brotli and HTTP3. I have left these in if you want to use a custom build.

@DavidHarper
DavidHarper / ibm2ieee.asm
Created May 21, 2022 09:18
VM/370 assembler code to convert VM/370 64-bit float to IEEE 64-bit float
* Name: IBM2IEEE ASSEMBLE IBM00010
* IBM00020
* Author: David Harper, University of Liverpool Computer Lab IBM00030
* Email: [REDACTED] IBM00040
* Date: 24 April 1989 IBM00050
* IBM00060
* Purpose: To convert IBM Dfloat data to IEEE IBM00070
* IBM00080
* Linkage convention: Waterloo C IBM00090
* IBM00100
@bryanmylee
bryanmylee / .storybook_main.cjs
Last active November 7, 2022 17:20
Svelte (kit) + Storybook + Webpack 5 configuration to support all modern features (optional chaining and nullish coalescence in templates)
const path = require('path');
const postcss = require('postcss');
const preprocess = require('svelte-preprocess');
const replaceFileExtension = (filePath, newExtension) => {
const { name, root, dir } = path.parse(filePath);
return path.format({
name,
root,
dir,