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
def music-all [] { | |
task spawn {glob ~/Music/**/*.{opus} | shuffle | mpv --force-window ...$in} | |
} | |
def music-all-sync [] { | |
glob ~/Music/**/*.{opus} | shuffle | mpv --force-window ...$in | |
} | |
def music-shuffle [folder] { | |
let glob_folder = $folder |
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
def opus [folder] { | |
let glob_folder = $folder | |
| str replace -a "]" "\\]" | |
| str replace -a "[" "\\[" | |
| str replace -a "(" "\\(" | |
| str replace -a ")" "\\)" | |
| str replace -a "," "\\," | |
let new_folder = ($folder | str replace -r "/$" "") + " - [OPUS]/" | |
let music_paths = glob ($glob_folder | path join "**/*.{flac,wav,aiff,aif,ogg,oga,pcm}") | |
let image_paths = glob ($glob_folder | path join "**/*.{png,jpg,jpeg}") |
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
#!/usr/bin/env nu | |
def extract-subs [] { | |
if (glob *.mkv | is-empty) { | |
error make {msg: "No .mkv files found" , help: "Script only work with .mkv files"} | |
} | |
print "START" | |
let paths = glob *.mkv --exclude ['._*'] | sort | |
let names = ls | get name | where { |f| $f | str ends-with '.mkv'} | each {|f| $f | str replace ".mkv" ""} | sort |
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
#!/usr/bin/env nu | |
if (glob *.mkv | is-empty) { | |
error make {msg: "No .mkv files found" , help: "Script only work with .mkv files"} | |
} | |
print "START" | |
let paths = glob *.mkv --exclude ['._*'] | sort | |
let names = ls | get name | where { |f| $f | str ends-with '.mkv'} | each {|f| $f | str replace ".mkv" ""} | sort | |
let tuple_list = $paths | zip $names | |
# print ($tuple_list | flatten) |
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
/// Implements equality comparison for Color instances. | |
/// Compares the colors represented as RGBA vectors for approximate equality, | |
/// using a tolerance specified by `f32::EPSILON`. | |
impl PartialEq for Color { | |
fn eq(&self, other: &Self) -> bool { | |
let self_rgba: Vec4 = self.as_rgba().into(); | |
let other_rgba: Vec4 = other.as_rgba().into(); | |
self_rgba.abs_diff_eq(other_rgba, f32::EPSILON) | |
} | |
} |
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
use std::cell::UnsafeCell; | |
pub struct Cell<T> { | |
value: UnsafeCell<T>, | |
} | |
// implied by UnsafeCell | |
// impl<T> !Sync for Cell<T> {} | |
impl<T> Cell<T> { | |
pub fn new(value: T) -> Self { | |
Cell { |
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
//! Renders a 2D scene containing a single, moving sprite. | |
use std::f32::consts::PI; | |
use bevy::prelude::*; | |
fn main() { | |
App::new() | |
.add_plugins(DefaultPlugins) | |
.add_startup_system(setup) |
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
| "OS Build Version" = "22A380" | |
+-o J274AP <class IOPlatformExpertDevice, id 0x100000207, registered, matched, active, busy 0 (7383 ms), retain 36> | |
| | | | "perf-states" = <0000000090010000007b9a175e02000000a4781f800200000054ea2aa6020000001f13370003000000ea3b435b03000080bb2c4ca3030000> | |
| | | | "gfx-shared-region-base" = <0080f7ff09000000> | |
| | | | "gpu-num-perf-states" = <06000000> | |
| | | | "AGXParameterBufferMaxSizeEverMemless" = 293076992 | |
| | | | "AGXParameterBufferMaxSizeNeverMemless" = 146538496 | |
| | | | "gpu-core-count" = 8 | |
| | | | "AGXParameterBufferMaxSize" = 439615488 | |
| | | | "GPUConfigurationVariable" = {"gpu_gen"=13,"num_gps"=4,"num_cores"=8,"core_mask_list"=(255),"num_frags"=8,"num_mgpus"=1} |
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
pub trait IteratorExt { | |
fn our_flatten(self) -> Flatten<Self> | |
where | |
Self: Iterator + Sized, | |
Self::Item: IntoIterator; | |
} | |
impl<T> IteratorExt for T | |
where | |
T: Iterator, |
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
https://www.youtube.com/watch?v=q6paRBbLgNw&list=PLqbS7AVVErFiWDOAVrPt7aYmnuuOLYvOa&index=2 | |
#[macro_export] | |
macro_rules! avec { | |
() => { | |
Vec::new() | |
}; | |
($($element:expr),+ $(,)?) => {{ | |
let mut vs = Vec::with_capacity($crate::count!($($element),+)); | |
$(vs.push($element);)+ |
NewerOlder