Skip to content

Instantly share code, notes, and snippets.

Yoshua Wuyts yoshuawuyts

Block or report user

Report or block yoshuawuyts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yoshuawuyts /
Created May 19, 2019 — forked from jamesmunns/
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
// required
let listener = TcpListener::bind((args.address.as_str(), args.port))?;
// what we want to be able to do
let listener = TcpListener::bind((&args.address, args.port))?;
set +ex
fr() {
rg -l "$1" | xargs sed -i "s/$1/$2/g"
# setup
fr 'atomic_waker' 'atomic_cx'
View udp-echo.js
let dgram = require('dgram')
let socket = dgram.createSocket('udp4', (msg, rinfo) => {
let peer = `${rinfo.address}:${rinfo.port}`
socket.send(msg, peer, (err) => {
if (err) peer.close()
console.log(`Sent ${rinfo.size} of ${rinfo.size} bytes to ${peer}`)


error: only the main function can be tagged with #[foob]
  --> tests/
45 | fn hello() {
   | ^^
error: aborting due to previous error
error: Could not compile `runtime`.
To learn more, run the command again with --verbose.                                                                                                                   [runtime:1]
let config = Config::from_args();
let mut app = tide::App::new(())
fn main() -> io::Result<()> {
executor::block_on(async {
let listener = TcpListener::bind(&"".parse().unwrap())?;
let mut incoming = listener.incoming();
while let Some(stream) = await!( {
let stream = stream?;
let addr = stream.peer_addr()?;
juliex::spawn(async move {
let (mut reader, mut writer) = stream.split();
#[derive(StructOpt, PartialEq, Debug)]
pub struct Cli {
bbox_1: u32,
bbox_2: u32,
bbox_3: u32,
bbox_4: u32,
fn main () {
let args = Cli::from_args();

Layering RPC over duplex connections

This is just a thing I've been thinking about for a while, and I'm not sure what the best structure is here. I'd be keen to hear more about examples, literature, and experiences on how people have approached this. I feel it's an important thing to start thinking about early when talking about networking, especially with HTTP/2 & HTTP/3 on the horizon.


Traditional HTTP servers can be expressed as asynchronous transform functions:

use wasm_bindgen::prelude::Closure;
use wasm_bindgen::JsCast;
use web_sys::{Document, EventTarget};
let document = Document::new().map_err(|_| ErrorKind::Document)?;
let target: EventTarget = document.into();
let cb = Closure::wrap(Box::new(move || {
println!("hello world from WASM");
}) as Box<Fn()>);
You can’t perform that action at this time.