Skip to content

Instantly share code, notes, and snippets.

View qryxip's full-sized avatar

Ryo Yamashita qryxip

  • Japan
  • 09:29 (UTC +09:00)
View GitHub Profile
@qryxip
qryxip / bisect.rs
Last active April 10, 2020 07:34
`as` free binary search for `RangeBounds<{Integer}>`
//! `as` free binary search for `RangeBounds<{Integer}>`.
//!
//! This code is licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0).
//!
//! ```cargo
//! [package]
//! name = "bisect"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! This code is licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0).
//!
//! ```cargo
//! [package]
//! name = "bash-on-atcoder"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! license = "CC0-1.0"
//! publish = false
//! This code is licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0).
//!
//! ```cargo
//! [package]
//! name = "bash-on-atcoder"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! license = "CC0-1.0"
//! publish = false
//! This code is licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0).
//!
//! ```cargo
//! [package]
//! name = "atcoder-cat"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! license = "CC0-1.0"
//! publish = false
//! This code is licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0).
//!
//! ```cargo
//! [package]
//! name = "logger"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! license = "CC0-1.0"
//! publish = false
@qryxip
qryxip / mimimimimi.rs
Last active March 17, 2020 04:53
______
//! ```cargo
//! [package]
//! name = "mimimimimi"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! publish = false
//!
//! # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
//!
#!/usr/bin/env bikecase
//! ```cargo
//! [package]
//! name = "hello-world"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! publish = false
//!
//! # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@qryxip
qryxip / atcoder-submissions.rs
Last active May 14, 2020 18:23
Scrape submitted code from AtCoder
//! This code is licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0).
//!
//! ```cargo
//! [package]
//! name = "atcoder-submissions"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! publish = false
//! license = "CC0-1.0"
@qryxip
qryxip / unchecked-slice-index.rs
Created November 21, 2019 09:53
Provides release mode only unchecked indexing like `unchecked-index` crate
/// The following code is licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/).
fn main() {
use unchecked_slice_index::SliceExt as _;
let mut xs = vec![0];
unsafe {
xs.with_unchecked_indices(|mut xs| {
xs[0] += 1;
assert_eq!(xs[0], 1);
@qryxip
qryxip / cargo-normal-deps.rs
Last active November 18, 2019 03:54
A cargo subcommand to list all of the "normal dependencies" in the dependency graph
//! A cargo subcommand to list all of the "normal dependencies" in the dependency graph.
//!
//! Licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/).
//!
//! ```toml
//! [package]
//! edition = "2018"
//! name = "cargo-normal-deps"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]