Standard escape codes are prefixed with Escape:
- Ctrl-Key: ^[
- Octal: \033
- Unicode: \u001b
- Hexadecimal: \x1B
- Decimal: 27
| #!/bin/bash | |
| # To ~/.bashrc file add line: | |
| # source ~/.git-plugin-bash.sh | |
| # Based on Oh My Zsh Git plugin (without zsh functions): | |
| # https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh | |
| # https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git | |
| # | 
| You are Manus, an AI agent created by the Manus team. | |
| You excel at the following tasks: | |
| 1. Information gathering, fact-checking, and documentation | |
| 2. Data processing, analysis, and visualization | |
| 3. Writing multi-chapter articles and in-depth research reports | |
| 4. Creating websites, applications, and tools | |
| 5. Using programming to solve various problems beyond development | |
| 6. Various tasks that can be accomplished using computers and the internet | 
| (cors) { | |
| @cors_preflight method OPTIONS | |
| header { | |
| Access-Control-Allow-Origin "{header.origin}" | |
| Vary Origin | |
| Access-Control-Expose-Headers "Authorization" | |
| Access-Control-Allow-Credentials "true" | |
| } | 
I used to have a site bookmarked with a table of all these functions, but the link is dead. Here's a matrix of Option and Result conversion functions. These become second nature once you have used Rust for any significant length of time, but it's useful to have a table reference.
For each of the below:
T is the value possibly contained in an input Ok Result or Some Option.U is a new value created by transforming or replacing an input T. Note that when
U appears in methods like map, U ?= T, for example by calling| { | |
| "version": "pre-draft", | |
| "platform": { | |
| "os": "linux", | |
| "arch": "amd64" | |
| }, | |
| "process": { | |
| "terminal": false, | |
| "user": { | |
| "uid": 0, | 
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| use hyper::{Client, Server, Request, Response, Body}; | |
| use anyhow::*; | |
| use std::net::SocketAddr; | |
| use hyper::service::{make_service_fn, service_fn}; | |
| use std::sync::{Arc, RwLock}; | |
| fn mutate_request(req: &mut Request<Body>) -> Result<()> { | |
| for key in &["content-length", "transfer-encoding", "accept-encoding", "content-encoding"] { | |
| req.headers_mut().remove(*key); | |
| } | 
| #!/bin/bash | |
| # vim:ft=zsh ts=2 sw=2 sts=2 et | |
| # Simple script to convert OGG to MP3 | |
| # http://github.com/netzverweigerer | |
| # Usage: ogg2mp3 <file1> [<file2> <file3> ...] | |
| # Set options for LAME encoder | |
| # vbr, ~192k: | 
| module slice | |
| func InterfaceSlice(slice interface{}) []interface{} { | |
| switch slice := slice.(type) { | |
| case []string: | |
| new := make([]interface{}, len(slice)) | |
| for i, v := range slice { | |
| new[i] = v | |
| } | |
| return new |