Skip to content

Instantly share code, notes, and snippets.

@mjohnsullivan
mjohnsullivan / http_server.rs
Last active August 23, 2024 03:19
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];
@subnut
subnut / transient_prompt.zsh
Last active November 10, 2024 14:22
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