Skip to content

Instantly share code, notes, and snippets.

View SpeedSX's full-sized avatar

speedsx SpeedSX

  • Kyiv, Ukraine
View GitHub Profile
@SpeedSX
SpeedSX / habr-swift-vs-rust.rs
Created July 18, 2020 20:05 — forked from frol/habr-swift-vs-rust.rs
My refactored version of Rust implementation to the article "Swift против Rust — бенчмаркинг на Linux с (не)понятным финалом" https://habr.com/en/post/450512/
//[dependencies]
//serde_json = "1.0"
use serde_json::Value;
use std::collections::{HashMap, HashSet};
const FILE_BUFFER_SIZE: usize = 50000;
//source data
#[derive(Default)]
@SpeedSX
SpeedSX / inputTypeNumberPolyfill.js
Created November 10, 2016 08:52 — forked from nbouvrette/inputTypeNumberPolyfill.js
Stand alone JavaScript polyfill allow only numbers on input of type number.
/**
* Stand alone polyfill allow only numbers on input of type number.
*
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on
* input of type text.
*
* Supports:
*