Skip to content

Instantly share code, notes, and snippets.

View qryxip's full-sized avatar

Ryo Yamashita qryxip

  • Japan
  • 12:17 (UTC +09:00)
View GitHub Profile
//! ```toml
//! [package]
//! edition = "2018"
//! name = "cargo-touch-workspace"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <[email protected]>"]
//! description = "Touch the source files in the workspace."
//! publish = false
//! license = "CC0-1.0"
//!
@qryxip
qryxip / parse_cfg.rs
Last active August 14, 2019 14:03
Parses `cfg(..)`
//! The following code is licenused under [`CC0-1.0`](https://creativecommons.org/publicdomain/zero/1.0/).
//!
//! ```toml
//! [package]
//! name = "parse_cfg"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <[email protected]>"]
//! edition = "2018"
//! license = "CC0-1.0"
//! publish = false
@qryxip
qryxip / atcoder.rs
Last active November 12, 2019 11:01
Template for AtCoder
//! ```cargo
//! [package]
//! name = "atcoder"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <[email protected]>"]
//! edition = "2015"
//! license = "MIT"
//! ```
#![allow(unused_imports)]
\documentclass[uplatex, a4j, 10pt, fleqn]{jsarticle}
\RequirePackage[l2tabu, orthodox]{nag}
\usepackage[dvipdfmx]{graphicx}
\usepackage{algorithm, algorithmic, amsmath, minted, newtxmath, url}
\usepackage{newtxtext, inconsolata}
\title{Title}
\date{\today}
#!/usr/bin/env run-cargo-script
//! ```cargo
//! [package]
//! name = "forge"
//!
//! [dependencies]
//! error-chain = "0.11.0"
//! futures = "0.1.21" # Not 0.2
//! hyper = "0.11.25"
//! reqwest = "0.8.5"
//! ```cargo
//! [dependencies]
//! error-chain = "0.11.0"
//! lazy_static = "1.0.0"
//! regex = "0.2.10"
//! reqwest = "0.8.5"
//! select = "0.4.2"
//! ```
#[macro_use] // `error_chain!`, `ensure!`, `quick_main!`
//! <https://qiita.com/tatsuya6502/items/cd448486f7ef7b5b8c7e>
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names, float_cmp))]
use std::fmt;
use std::io::{self, BufRead};
use std::str::{self, FromStr};
fn main() {
let stdin = io::stdin();
@qryxip
qryxip / wi2-300-login.py
Last active February 5, 2018 08:46
Wi2 300へのログイン
#!/usr/bin/env python3
# coding: utf-8
import os
import subprocess
import sys
import urllib.parse
import warnings
import click
@qryxip
qryxip / cmus-title.rs
Last active December 12, 2020 11:49
A script for status bars like yabar or xmobar that prints the title of the music currently played on CMus.
#!usr/bin/env run-cargo-script
use std::io::{self, BufRead, BufReader};
use std::process::{ChildStdout, Command, Stdio};
fn main() {
use std::io::ErrorKind::NotFound;
match cmus_status() {
Err(ref e) if e.kind() == NotFound => println!(" \"cmus-remote\" not found"),