Skip to content

Instantly share code, notes, and snippets.

@subnut
subnut / transient_prompt.zsh
Last active June 25, 2024 12:48
Transient prompt for zsh (insipred by romkatv's powerlevel10k)
### Simple transient prompt
[[ -c /dev/null ]] || return
zmodload zsh/system || return
## Set the transient prompt PROMPT here -
TRANSIENT_PROMPT='%# ' # Sample value
function set_prompt {
## Set the values of PROMPT and RPROMPT here
@mjohnsullivan
mjohnsullivan / http_server.rs
Last active March 12, 2024 16:08
Simple HTTP server example for Rust
// Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust
// to work with Rust 1.0 beta
use std::net::{TcpStream, TcpListener};
use std::io::{Read, Write};
use std::thread;
fn handle_read(mut stream: &TcpStream) {
let mut buf = [0u8 ;4096];