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
/// Traverse up to the workspace root. Panics if no `[workspace]` is found in any Cargo.toml files. | |
fn workspace_dir() -> PathBuf { | |
let crate_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set")); | |
let mut dir = Some(crate_dir.as_path()); | |
while let Some(current) = dir { | |
let toml_path = current.join("Cargo.toml"); | |
if toml_path.exists() { | |
if let Ok(contents) = fs::read_to_string(&toml_path) { | |
if contents.contains("[workspace]") { | |
return current.to_path_buf(); |
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
# Delete all local git branches except develop and master | |
git branch | grep -v "master\|develop" | xargs git branch -D | |
# Save above command as "git clean-branches" alias | |
git config --global alias.clean-branches "!git branch | grep -v 'master\|develop' | xargs git branch -D" | |
# References | |
# https://coderwall.com/p/x3jmig/remove-all-your-local-git-branches-but-keep-master | |
# https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases |
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
html, body { | |
margin-right: calc((100vw - 100%) * -1); | |
} |