This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-09-21T11:35:17.760Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require "benchmark/memory" | |
def func() | |
target, *arr = IO.readlines('input.txt', ' ') | |
target, first_el = target.split("\n") | |
arr.unshift(first_el) | |
target = target.to_i | |
while el = arr.shift | |
delta = target - el.to_i | |
if arr.bsearch { |e| !!e.match(%r{#{delta.to_s}(\n)?}) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.class_eval do | |
COLORS = { | |
white: "\033[37m", | |
yellow: "\033[33m", | |
green: "\033[32m", | |
blue: "\033[34m", | |
cyan: "\033[36m", | |
red: "\033[31m", | |
magenta: "\033[35m", | |
black: "\033[30m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AAARRRRGH | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Play aargh on server down | |
// @author maxim bezlegkiy | |
// @match https://www.uptimia.com/cp | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module OpenApiTypeConverter | |
class << self | |
def short(value, field_name) | |
value = value.to_i | |
value.bit_length > 32 ? raise(ValueIsTooLargeForInt64, field_name) : value | |
end | |
def long(value, field_name) | |
value = value.to_i | |
value.bit_length > 64 ? raise(ValueIsTooLargeForInt64, field_name) : value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
class RedisService | |
attr_accessor :host, :port | |
LINE = "\r\n" | |
def initialize(host, port, password: nil) | |
@host = host | |
@port = port |