This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::str; | |
| fn main() { | |
| // -- FROM: vec of chars -- | |
| let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
| // to String | |
| let string1: String = src1.iter().collect::<String>(); | |
| // to str | |
| let str1: &str = &src1.iter().collect::<String>(); | |
| // to vec of byte |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #---------------GitHub Pages + Namecheap Domain + SSL Cheat Sheet------------# | |
| NOTE: You do NOT need to buy PositiveSSL from Namecheap. | |
| GitHub Pages provides free SSL automatically via Let's Encrypt. | |
| # Namecheap Domain Setup | |
| Buy Domain | |
| Go to namecheap.com, select and buy domain name. | |
| Navigate to DNS Settings | |
| Login to Namecheap → Username dropdown → Dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############## | |
| # pretty prompt and font colors | |
| ############## | |
| # alter the default colors to make them a bit prettier | |
| echo -en "\e]P0000000" #black | |
| echo -en "\e]P1D75F5F" #darkred | |
| echo -en "\e]P287AF5F" #darkgreen | |
| echo -en "\e]P3D7AF87" #brown | |
| echo -en "\e]P48787AF" #darkblue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; str-split : Apr 2006 Doug Hoyte, hcsw.org. | |
| ;;; ---- | |
| ;;; Splits a string 'str into a list of strings | |
| ;;; that were separated by the delimiter character 'ch | |
| ;;; ---- | |
| ;;; Efficient as possible given that we can't count on | |
| ;;; 'str being an immutable string. | |
| (define (str-split str ch) | |
| (let ((len (string-length str))) |