Skip to content

Instantly share code, notes, and snippets.

View ivandenysov's full-sized avatar

Ivan Denysov ivandenysov

View GitHub Profile
# @param {String} s
# @return {String}
def decode_string(s)
puts "decoding #{s.inspect}"
digits = ('0'..'9').to_set
result = ""
multiplier = ""
group = ""
@ivandenysov
ivandenysov / fibonacci_sequence.rb
Last active May 20, 2018 14:28
Even Fibonacci Numbers
class FibonacciSequence
DEFAULT_MAX = 4_000_000
DEFAULT_FILTER_BY = :even?
def initialize(max: DEFAULT_MAX, filter_by: DEFAULT_FILTER_BY)
@max = max
@filter_by = filter_by
validate_arguments
@ivandenysov
ivandenysov / lab01_r04.pas
Created September 21, 2016 15:25
lab01_r04
program lab01_r04;
var a, b, c, d: integer;
begin
a:= 157 div 11;
b:= 28 div 5;
c:= 18 mod 17;
d:= 113 mod 45;
writeln(a);
writeln(b);
writeln(c);
@ivandenysov
ivandenysov / gist:e9ca9fe37365a6e3d633
Last active October 15, 2015 12:06
stripe_subscription
curl https://api.stripe.com/v1/customers/cus_67Ma6C0BV7XwvK/subscriptions \
-u sk_test_blalbalbalbal: \
-d plan=d6283e42-e466-4897-939e-cae96b04cd5b \
-d coupon=10BUCKS
# 1 core (default)
time bundle # => 8:26.86 total
# 4 cores
bundle config --global jobs 4
time bundle # => 3:20.80 total