Skip to content

Instantly share code, notes, and snippets.

View keturiosakys's full-sized avatar

Laurynas Keturakis keturiosakys

View GitHub Profile
@keturiosakys
keturiosakys / binary-pals.rs
Created May 15, 2023 16:26
Binary palindrome checker
fn main() {
let num = 5;
let res = binary_pal(num);
println!("{}", res);
}
fn binary_pal(num: i32) -> bool {
let binary = format!("{:b}", num);
let reversed: String = binary.chars().rev().collect();
if binary == reversed {
set appName to "WezTerm"
set yabaiQuery to "/opt/homebrew/bin/yabai -m query --windows | /opt/homebrew/bin/jq '.[] | select(.app==\"" & appName & "\") | .id'"
set windowId to do shell script yabaiQuery
if application appName is running then
tell application "System Events"
if visible of application process appName is true then
set visible of application process appName to false
else