I hereby claim:
- I am mrbaguvix on github.
- I am mrbaguvix (https://keybase.io/mrbaguvix) on keybase.
- I have a public key ASCxHA1onX2VamExp7BF2QHF6Aq1vgb9kp96x0PHa2asRgo
To claim this, I am signing this object:
| // ❌ snippet_a | |
| // This wouldn't work in Rust compiler because we're trying to change immutable data in memory | |
| // https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#variables-and-mutability | |
| // Look at the fix in *snippet_b* | |
| let mut_data:Vec<(),()> = Vec::new(); | |
| for datum in set_of_data { | |
| mut_data.push(datum); | |
| } | |
| // ✅ snippet_b |
| fn main() -> Result<(), std::process::ExitCode> { | |
| invert_binary_tree_once(Some(🌳)); | |
| Ok(std::process::ExitCode::SUCCESS) | |
| } | |
| #[must_use = "You darn bloke! use a type that implements a *Copy* trait."] | |
| struct BnTree; | |
| fn invert_binary_tree_once(&mut b_tree: Option<BnTree>) -> Option<BnTree> { |
| // https://nodejs.org/docs/latest-v18.x/api/vm.html | |
| const vm = require("vm"); | |
| // create an object in heap | |
| const sandboxCtx = {}; | |
| // Contextify the sandbox. | |
| vm.createContext(sandboxCtx); | |
| let code = 'var human = 2; let fish = "a big fish :)"'; |
| // use good 'ol c-language one-liner (rust doesn't have terniary operator 🙂) | |
| let x = if true { if false { true } else { false } } else { if true { false } else { true } }; | |
| // could also be | |
| let x = if true { !false } else { !true }; | |
| // even further | |
| let x = if true { true } else { false }; |
| #!/bin/bash | |
| # import multiple remote git repositories to local CODE dir | |
| # settings | |
| remoteHost=bitbucket.org | |
| remoteUser=mrbaguvix | |
| remoteDir="~/scm/remote_dir/" | |
| branchName="branch_name" | |
| remoteRepos=$(ssh -l $remoteUser $remoteHost "ls $remoteDir") |
| #[macro_use] | |
| extern crate lazy_static; | |
| use regex::{Captures, Regex}; | |
| // starts with "1" or "3" or "bc1" | |
| // doesn’t contain ambiguous characters | |
| // consists of uppercase or lowercase alphabetic and numeric characters | |
| // except the uppercase letter "O", uppercase letter "I", lowercase letter "l", and the number "0" | |
| // check that the string is 26-35 characters long |
| use std::collections::{BTreeMap, HashMap}; | |
| fn main() { | |
| let frequency = [19, 19, 20, 32, 35, 19, 32]; | |
| // use hashmap to store k/v pairs | |
| let mut seek_hash: HashMap<i32, u8> = HashMap::new(); | |
| let mut seek_hash_sorted: BTreeMap<i32, u8> = BTreeMap::new(); | |
| let mut highest_freq_val = 0; | |
| let mut highest_freq_key = 0; |
| app.get("/check", middleWare, (_, res) => { | |
| res.send("Hello boi"); | |
| }); |
I hereby claim:
To claim this, I am signing this object:
| const { spawn } = require('child_process'); | |
| const fs = require('fs'); | |
| const cmdProcesses = { | |
| processDaemon: function(file) { | |
| return new Promise((resolve, reject) => { | |
| const args = [file, 'cron', '-', 'output', '-']; | |
| const childProcess = spawn('baguvix', args); |