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
@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

@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
#
@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
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));
@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
@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)
@krakjoe
krakjoe / pthreads.md
Last active August 30, 2023 18:30
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls