Skip to content

Instantly share code, notes, and snippets.

View sagebind's full-sized avatar
💭
Limited availability for Open Source

Stephen M. Coakley sagebind

💭
Limited availability for Open Source
View GitHub Profile
@krakjoe
krakjoe / pthreads.md
Last active September 24, 2024 14:50
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@bvssvni
bvssvni / gist:9674632
Last active December 23, 2023 22:56
A Rust Chain Macro
//! Chain macro in Rust
//!
//! A typical usage is to avoid nested match expressions.
//!
//! Supports:
//! - Pattern matching
//! - Or expressions (A | B => ...)
//! - Guarded statements (x if <cond> => ...)
//! - Implicit else (requires all arms to return same type)
@kevinmehall
kevinmehall / rust-cross-libs.sh
Last active November 3, 2023 13:23
Cross-compile Rust standard library for Tessel without full bootstrap build [A work in progress]
#!/bin/bash
# THIS IS A GIANT HACK
# if you think this would be a good idea if it weren't so terrible, go read https://github.com/rust-lang/rfcs/pull/1133
set -e
# Parse args
for i in "$@"
do
anonymous
anonymous / main.rs
Created July 30, 2015 22:29
extern crate regex;
use std::io::{Write, stderr};
use regex::{Regex, Captures};
type Error = Box<::std::error::Error + Send + Sync>;
fn captures<'t>(pat: &str, txt: &'t str) -> Result<Vec<Captures<'t>>, Error> {
let re = try!(Regex::new(pat));
@kidpixo
kidpixo / fuzzyjump.fish
Last active June 24, 2016 07:01
Fuzzy jumping in one of the ~/.marks bookmarks used by jump/autojump. Requires fzf installed and some links in ~/.marks . Defines an 'fj' alias.
function fuzzyjump
# fuzzy cd in one of the ~/.marks bookmarks used by jump/autojump
# requires fzf installed and some links in ~/.marks
ls -l ~/.marks | awk '{print $9 $10 $11}'| sed -e '/^$/d' -e 's/\(->\)/|\1/' | column -s"|" -t | fzf | awk -F">" '{print $2}' | read -l fzf_local_result
if test -d $fzf_local_result
cd $fzf_local_result
else
echo "Directory does not exist $fzf_local_result"
end
@japaric
japaric / build.sh
Last active May 12, 2022 14:29
rustc for x86_64-unknown-linux-musl
# Build an statically linked rustc (with host=x86_64-unknown-linux-musl)
# Last tested on: 9316ae515e2f8f3f497fb4f1559910c1eef2433d
# Usage:
# # patches must be in $(pwd)
# $ ls *.patch
# liblibc.patch rust.patch
#
@Matthias247
Matthias247 / a_case_for_cancellationtokens.md
Last active January 17, 2022 22:50
A case for CancellationTokens

A case for CancellationTokens

Background

The Rust async working group is currently actively discusing on ways to improve async/await. Niko Matsakis documented the main goals and ideas in the async vision document.

As part of the improved async ecosytem, users should be able to make use of

@Lukas-Krickl
Lukas-Krickl / 00-project-reactor-from-zero-to-hero.md
Last active April 29, 2025 06:11
A java project reactor tutorial/discussion reaching from basic concepts to reactor internal implementation details.

Project Reactor: From Zero to Hero

In this series of pages, I will discuss project reactor and reactive programming from basic concepts to reactor internal implementation details. This discussion is based on the official reference documentation, the java-doc, talks by maintainers of reactor e.g. at the spring I/O and other distributed material, and should summarise and connect all this information. It should complement the official reference documentation and java-doc. Although the name says "from zero to hero", basic knowledge about the library is advised to fully benefit from it.

As a short disclaimer, I am a professional software engineer with some years of experience in using reactor, but not a maintainer or creator of the library. Information and knowledge in this post are based on the official documentation and talks, but I cannot exclude misconceptions on my side.


  1. [Why and when to use Reactor](https://gist.github.com/Lukas-Krickl/50f1daebebaa72c7e944b7c319e3c073#file-01-why-and-when-to-use