Skip to content

Instantly share code, notes, and snippets.

🦀
You want to contact me? Come to miaou (https://miaou.dystroy.org) and ask for me

Canop Canop

🦀
You want to contact me? Come to miaou (https://miaou.dystroy.org) and ask for me
Block or report user

Report or block Canop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Canop
Canop / broot-neovim-terminator_workflow.md
Created Apr 12, 2020
broot + neovim + terminator workflow
View broot-neovim-terminator_workflow.md

Introduction

I document here the new workflow I'm tuning in which I combine broot, neovim and terminator for enjoyable coding. I'll use here as support the exemple of Rust but it works about the same in other environnements.

Goals

  • keep open broot and neovim side to side and use broot as tree viewer and opener for vim
  • have a flexible setup: broot, neovim and terminator are basic tools that you should keep using as you do, this new combinations isn't a different world
  • Keep neovim uncluttered, don't prevent the shortcuts you already use for navigation and opening
View main.rs
use {
crossterm::style::Colorize,
rand::Rng,
std::io::*,
};
fn int() -> i64 {
rand::thread_rng().gen_range(10, 50)
}
View debug_time.rs
/// print the time that executing $timed took
/// but only when the log level is "debug".
/// The goal of this macro is to avoid doing useless
/// Instant::now in non Debug executions.
///
/// Examples:
/// ```
/// let sum = time!(
View gist:93a030837272900d5796efde74c334e9
dys@tour-noire:~/dev/termimad> cargo tree
termimad v0.6.1 (/home/dys/dev/termimad)
├── crossbeam v0.7.2
│ ├── cfg-if v0.1.9
│ ├── crossbeam-channel v0.3.9
│ │ └── crossbeam-utils v0.6.6
│ │ ├── cfg-if v0.1.9 (*)
│ │ └── lazy_static v1.3.0
│ ├── crossbeam-deque v0.7.1
│ │ ├── crossbeam-epoch v0.7.2
View gist:6a267e586e5f912754305a91d53e2f45
# Code with semicolons:
use std::fmt;
use minimad::Text;
use crate::skin::MadSkin;
use crate::code;
use crate::line::FmtLine;
use crate::tbl;
View gist:9ac44f78b4aba0290978a9b5f26eb1b1
dys@tour-noire:~/dev/broot> cargo install cargo-crev
Updating crates.io index
Downloaded cargo-crev v0.7.0
Downloaded 1 crates (18.5 KB) in 1.64s
Installing cargo-crev v0.7.0
Downloaded crev-common v0.7.0
Downloaded serde_yaml v0.8.9
Downloaded crev-data v0.7.0
Downloaded flate2 v1.0.8
Downloaded common_failures v0.1.1
View gist:2c00267692fff59df254cc2f6da03c87
I am the Miaou user with id 4 and name "dystroy" on http://127.0.0.1:8204
@Canop
Canop / float.js
Last active May 16, 2018
float numbers formatting
View float.js
const float = function(v, p=2){
let absv = Math.abs(v);
if (absv>10**(p+3) || absv<10**-p) return v.toExponential(p).replace(/0+e/, 'e');
return v.toFixed(p).replace(/\.0+$|0+$/, '');
}
// run the following to test the float function and
// compare the values with common formatting functions
const bodys = [
View gist:5d0dc64cccaaff04ae2d15626217a596
function serie(start, max){
var arr = [];
for (var a = Math.ceil(456/100)*100; a ??? ; a ???) arr.push(a);
return arr;
}
console.log(serie(456, 2000));
View Miaou-Canop
I am the Miaou user with id 2 and name "Canop" on https://dystroy.org/miaou
You can’t perform that action at this time.