Skip to content

Instantly share code, notes, and snippets.

View loganmzz's full-sized avatar
🐒
Doing some stuff with K8S, CF and Rust

Logan Mzz loganmzz

🐒
Doing some stuff with K8S, CF and Rust
View GitHub Profile
@adojos
adojos / git-for-win_Pacman_Install.md
Last active July 6, 2024 09:41
Git: Pacman Installation on Git For Windows #git

Git For Windows (GitBash) Pacman Installation

The 'Git for Windows' by default does not come with MSYS2 package manager called 'Pacman' and hence it is a limited version or subset of the MSYS2. Also the bash which supplied wih 'Git for Windows' is not a full version of bash hence does not provide for full Linux environment.

However you can get package manager support inside 'Git for Windows' in following ways :

  1. Install full MSYS2 and build Git for Windows yourself (Most git users don't require all packages and MSYS2)
  2. Install Git for Windows SDK (heavy & consumes around 3-5 Gb space)
  3. Use a hack to merge the MSYS2 Pacman packages with your existing Git for Windows installation
@d-plaindoux
d-plaindoux / for-comprehension.rs
Last active September 8, 2018 09:04
Scalas' for comprehension in Rust
#[macro_export]
macro_rules! foreach {
($a:ident <- ($e:expr) if ($cond:expr) yield $result:expr) => {{
$e.filter(|$a| $cond).map(|$a| $result)
}};
($a:ident <- ($e:expr) yield $result:expr) => {{
$e.map(|$a| $result)
}};
($a:ident <- ($e:expr) $($r:tt)+) => {{
$e.flat_map(|$a| foreach!($($r)+))
@d-plaindoux
d-plaindoux / comprehension.rs
Last active September 7, 2018 08:20
Simple comprehension macro in Rust
#[macro_export]
macro_rules! comprehension {
(($expr:expr) | $id:ident <- ($range:expr) if $cond:expr) => {{
let mut result = Vec::default();
for $id in $range {
if $cond {
result.push($expr);
}
}