Skip to content

Instantly share code, notes, and snippets.

View YoshiTheChinchilla's full-sized avatar
:octocat:
On GitHub

Yoshi YoshiTheChinchilla

:octocat:
On GitHub
  • Worldwide
View GitHub Profile
@YoshiTheChinchilla
YoshiTheChinchilla / try_from_vec_array.rs
Created August 6, 2020 09:55
Simple and efficient Vec<[T; N]> into Vec<T> implementation
#![allow(incomplete_features)]
#![feature(const_generics)]
#[derive(Debug)]
pub enum TryFromVecArrayError {
OverflowedLen,
OverflowedCap,
}
pub trait TryFromVecArray<T, const N: usize> {
@YoshiTheChinchilla
YoshiTheChinchilla / Cargo.toml
Last active June 3, 2020 08:59
A ChiGyu (cheese gyūdon), Japanese internet meme library written in Rust
[package]
name = "chigyu"
version = "0.1.0"
authors = ["Takashi Yoshimura"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "chigyu"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>use statement generator for Rust playground</title>
<script src="https://binarymuse.github.io/toml-node/js/toml.js"></script>
<script>
(async () => {
const tomlText = await fetch('https://raw.githubusercontent.com/integer32llc/rust-playground/master/compiler/base/Cargo.toml')
@YoshiTheChinchilla
YoshiTheChinchilla / http-status-codes.json
Created April 4, 2020 08:44
HTTP status code map in JSON
{
"100": "Continue",
"101": "Switching Protocols",
"102": "Processing",
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-Authoritative Information",
"204": "No Content",
"205": "Reset Content",

The Joel Test

The neat thing about The Joel Test is that it’s easy to get a quick yes or no to each question. You don’t have to figure out lines-of-code-per-day or average-bugs-per-inflection-point. Give your team 1 point for each “yes” answer. The bummer about The Joel Test is that you really shouldn’t use it to make sure that your nuclear power plant software is safe.

A score of 12 is perfect, 11 is tolerable, but 10 or lower and you’ve got serious problems. The truth is that most software organizations are running with a score of 2 or 3, and they need serious help, because companies like Microsoft run at 12 full-time.

Of course, these are not the only factors that determine success or failure: in particular, if you have a great software team working on a product that nobody wants, well, people aren’t going to want it. And it’s possible to imagine a team of “gunslingers” that doesn’t do any of this stuff that still manages to produce incredible software that changes the world. But, all else bei

// https://www.oreilly.co.jp/ebook/
// or JSON without file types
// https://www.oreilly.co.jp/catalog/
const rows = [...document.querySelector('#bookTable').rows]
rows.shift()
const books = rows.map(r => {
const [isbnElm, titleElm, priceElm, dateElm, typesElm] = r.children
@YoshiTheChinchilla
YoshiTheChinchilla / devdocs.json
Created February 3, 2020 07:58
My devdocs.io setting data https://devdocs.io
{"analyticsConsentAsked":"1","analyticsConsent":"1","docs":"dom/dom_events/http/javascript/rust/async/cpp/d/docker~19/elixir~1.9/go/godot~3.1/haskell~8/koa/nim/node/phaser/pony/pug/redis/scala~2.13_library/sqlite/typescript/vue_router/vue~2/vuex","arrowScroll":"1","layout":"_max-width%20_sidebar-hidden"}
[package]
name = "bonfire"
version = "0.1.1"
authors = ["Takashi Yoshimura"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "bonfire"
url: https://github.com/YoshiTheChinchilla
id: YoshiTheChinchilla
name: Yoshi
public_email:
avatar_url: https://gist.githubusercontent.com/YoshiTheChinchilla/ecd4df4564441fc5355d296035b76c83/raw/~github-avatar.png
status:
emoji: octocat
field: On GitHub
Busy: false
# ["Never", "in 30 minutes", "in 1 hour", "in 4 hours", "today", "this week"]
const spaceEvent = new KeyboardEvent('keyup', {
bubbles: false,
cancelable: false,
char: " ",
key: " ",
shiftKey: false,
keyCode: 32
})
words.forEach(w => (w + ' ').split('').forEach(c => ($inputfield[0].value += c) && $inputfield.trigger('keydown') && c === ' ' ? $inputfield[0].dispatchEvent(spaceEvent) : $inputfield.trigger('keyup')))