This file contains 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
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 { |
This file contains 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
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 |