Skip to content

Instantly share code, notes, and snippets.

View lazywalker's full-sized avatar
💭
reborn

lazywalker

💭
reborn
View GitHub Profile
@lazywalker
lazywalker / option_to_error.rs
Created October 8, 2021 16:33
Extends the `?` operator to Option types by Wrap the Option to Error
pub trait Sealed {}
impl<T> Sealed for Option<T> {}
pub trait Context<T, E>: Sealed {
/// Wrap the Option to a general error.
fn ok(self) -> Result<T, Error>;
/// Wrap the Option with additional message
fn err<C>(self, context: C) -> Result<T, Error>
@lazywalker
lazywalker / gist:7da798ad315180876184e66ac963068d
Created October 13, 2020 04:55
Weechat with irc.gitter.im
/server add gitter irc.gitter.im -ssl
/secure set gitter mypass
/set irc.server.gitter.password ${sec.data.gitter}
/connect gitter
@lazywalker
lazywalker / tmux-linked-panes.md
Created October 11, 2020 01:35
tmux linked panes

Main idea:

we can't link-panes, but we can use tmux nested & linked-window to achieve our goal. Here is how.

Step 1

Create the session that will manage the linked panes

  • create new session named shared
$ tmux new -s shared