Skip to content

Instantly share code, notes, and snippets.

View SpeedSX's full-sized avatar

speedsx SpeedSX

  • Kyiv, Ukraine
View GitHub Profile
@SpeedSX
SpeedSX / int_to_roman.rs
Last active February 3, 2019 19:40
Integer to Roman
fn main() {
let result = Solution::int_to_roman(3999);
println!("{}", result);
}
struct Solution {}
impl Solution {
pub fn int_to_roman(num: i32) -> String {
let divs = vec![
@SpeedSX
SpeedSX / queens.py
Created January 30, 2019 13:42
Queens
def put_queen(q, row, n):
for c in range(n):
if check_column(q, row, n, c):
if check_diag(q, row, n, c):
q[row] = c
if row < n - 1:
put_queen(q, row + 1, n)
else:
print(q)
@SpeedSX
SpeedSX / entity_cleanup.rs
Last active March 4, 2020 08:58
Azure CosmosDB with Rust
extern crate azure_sdk_for_rust;
extern crate chrono;
extern crate futures;
extern crate hyper;
extern crate hyper_tls;
extern crate tokio_core;
extern crate serde;
extern crate serde_json;
use std::fs::File;

Keybase proof

I hereby claim:

  • I am speedsx on github.
  • I am speedsx (https://keybase.io/speedsx) on keybase.
  • I have a public key ASCEV49A3ZYMP_N6gBNGBZvH9V7rEFJRUCafrERWhsdRtQo

To claim this, I am signing this object:

@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:
*