Skip to content

Instantly share code, notes, and snippets.

View danii's full-sized avatar

Daniel danii

View GitHub Profile
@danii
danii / node-stack-notes.js
Last active February 20, 2021 05:03
Information on node.js's stack traces.
//PseudoJSON {name:evaluateeFunc,file:evaluatee-file-name,line:evaluatee-line,column:evaluatee-column,evaluater:{name:middleEvaluater,evaluater:{name:evaluaterFunc,file:evaluater-file-name,line:evaluater-line,column:evaluater-column}}}
//Stack at {evaluateeFunc} (eval at {middleEvaluater} (eval at {evaluaterFunc} ({evaluater-file-name}:{evaluater-line}:{evaluater-column})), {evaluatee-file-name}:{evaluatee-line}:{evaluatee-column})
//PseudoJSON {name:evaluateeFunc,file:evaluatee-file-name,line:evaluatee-line,column:evaluatee-column,evaluater:{name:evaluaterFunc,file:evaluater-file-name,line:evaluater-line,column:evaluater-column}}
//Stack at {evaluateeFunc} (eval at {evaluaterFunc} ({evaluater-file-name}:{evaluater-line}:{evaluater-column}), {evaluatee-file-name}:{evaluatee-line}:{evaluatee-column})
//PsuedoJSON {name:funcName,file:file-name,line:line,column:column}
//Stack at {funcName} ({file-name}:{line}:{column})
//PseudoJSON {name:<anonymous>,file:file-name,line:line,column:column}
//Stack at {file-name}
@danii
danii / README.md
Created July 28, 2020 18:23
Rust Donuts!

Rust Donut

This was transpiled completely from code and other links found on a1k0n.net.

@danii
danii / rust_core_test_iter_fns.txt
Last active February 20, 2021 05:04
Programmatic rust file splitter
mod::traits::iterator fn test_lt
mod fn test_multi_iter
mod::traits::iterator fn test_cmp_by
mod::traits::iterator fn test_partial_cmp_by
mod::traits::iterator fn test_eq_by
mod fn test_counter_from_iter
mod::adapters::chain fn test_iterator_chain
mod::adapters::chain fn test_iterator_chain_nth
mod::adapters::chain fn test_iterator_chain_nth_back
mod::adapters::chain fn test_iterator_chain_last

Keybase proof

I hereby claim:

  • I am danii on github.
  • I am daniihh (https://keybase.io/daniihh) on keybase.
  • I have a public key ASDbvvJvVZn1_ezapmOp4ujimyekAkiBdq2VNyz73xviWQo

To claim this, I am signing this object:

use std::{
collections::VecDeque,
future::Future,
io::{Error as IOError, ErrorKind as IOErrorKind, Result as IOResult},
ops::Try,
pin::Pin,
task::{Context, Poll}
};
use tokio::{fs::File, io::{AsyncRead, AsyncWrite, ReadBuf}, process::Child};
@danii
danii / test.md
Last active February 20, 2021 05:06

Testing
:)

Just a test section. Sadly this won't render as intended on GitHub. ¯\_(ツ)_/¯
@danii
danii / feh-multi-wallpaper-bg.sh
Created April 28, 2021 02:14
An over engineered script to use feh for multi-wallpaper desktops.
#!/bin/sh
AWK_XRANDR_PARSE='/ connected/ {
split($3,sizePos,"+")
split(sizePos[1],size,"x")
print size[1] "," size[2] "," sizePos[2] "," sizePos[3]
}'
# Fetches a wallpaper for the monitor of size $1x$2. $1 is the required width,
# and $2 is the required height.
@danii
danii / lib.rs
Created November 22, 2021 23:53
iter! Macro
use std::iter::{empty, once};
macro_rules! iter {
() => {empty()};
($first:expr $(, $($rest:expr),*)?) => {
once($first).chain(iter![$($($rest),*)?])
}
}
@danii
danii / a.sh
Created December 27, 2022 08:49
a
# danii 2021 do not steal
FILE=$(realpath $1)
WD=$(mktemp -d)
cd $WD
printf '%s' "$WD"
split -b100000000 "$FILE" ./data
ls | xargs -P5 -I{} uploadr {};
rm -r $WD