Skip to content

Instantly share code, notes, and snippets.

@zoeisnowooze
zoeisnowooze / reorder.rs
Last active Oct 19, 2021 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View reorder.rs
#![allow(unused)]
fn reorder<T: Clone>(values: Vec<T>, indices: Vec<usize>) -> Vec<Option<(usize, T)>> {
let mut pairs: Vec<_> = indices.iter().zip(values).collect();
pairs.sort_by_key(|v| v.0);
let mut iter = pairs.iter().peekable();
(0..*pairs.last().unwrap().0 + 1)
.map(|i| match iter.peek() {
Some((j, _)) => {
@zoeisnowooze
zoeisnowooze / is_odious.rs
Created Oct 11, 2021 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View is_odious.rs
//! Checks if an integer is an odious number.
/// Determine if an integer is an odious number.
///
/// 14 is an odious number because it has an odd number of 1s in its binary
/// expansion 1110. Conversely, 5 isn't an odious number. It has an even number
/// of 1s in its binary expansion 101 and so is called an evil number.
fn is_odious(num: i64) -> bool {
let mut num = num;
let mut sum = false;
@zoeisnowooze
zoeisnowooze / Trans Voice Practice Log.md
Last active Oct 7, 2021
Markdown version of Renée Yoxon's Trans Vocal Exploration practice log template, click the "Raw" button and save to your template folder
View Trans Voice Practice Log.md
date
{"date"=>nil}

🔋 Energy:: (1 - 10) 🧠 Mental state:: (Happy Sad Contented Dysphoric Angry Excited Neutral) 👟 Physical state:: (Tired Energized In Pain Neutral)

Check-in

@zoeisnowooze
zoeisnowooze / witchhazelhypercolor.zsh-theme
Last active Jul 27, 2021
Witch Hazel Hypercolor ZSH Theme
View witchhazelhypercolor.zsh-theme
# Witch Hazel Hypercolor ZSH Theme
#
# by @medecau and @zoeisnowooze
# Witch Hazel by @theacodes
#
# https://witchhazel.thea.codes/
# https://twitter.com/ZoeIsNowOoze/status/1418271734327820289
#
# 1. Create a file ~/.oh-my-zsh/custom/themes/witchhazelhypercolor.zsh-theme
#