Skip to content

Instantly share code, notes, and snippets.

View wojkos's full-sized avatar

Wojciech Kostański wojkos

View GitHub Profile
import subprocess
# var = subprocess.call("date")
# subprocess.call(["ls", "-l", "/etc/hosts"])
# p = subprocess.Popen("date", stdout=subprocess.PIPE, shell=True)
# (output, err) = p.communicate()
# print("Today is", output)
# p = subprocess.Popen(["ls", "-l", "/etc/hosts"], stdout=subprocess.PIPE)
# output, err = p.communicate()
@wojkos
wojkos / cache_recursion.rb
Created December 3, 2018 14:00
cassino_game created by wojkos - https://repl.it/@wojkos/cassinogame
@cache = []
def cache_recursion_solution(n, k)
end
@wojkos
wojkos / main.rb
Last active December 3, 2018 13:33
cassino_game created by wojkos - https://repl.it/@wojkos/cassinogame
# wined coins
n1 = 10
n2 = 18
# used all-in
k1 = 10
k2 = 2
def solution(n, k)
steps = 0
while n > 1
@wojkos
wojkos / main.rb
Created November 14, 2018 09:59
FarawayDistortedUsernames-1 created by wojkos - https://repl.it/@wojkos/FarawayDistortedUsernames-1
text = {:user=>{:first_name=>["must be filled"], :email_address=>["Wrong email format"], :phone_number=>["Wrong phone number format. Use only digits with + on begining"], :address_attributes=>{:street=>["must be filled"], :city=>["must be filled"], :zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}, :company_attributes=>{:address_attributes=>{:zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}}}}
# def parse v
# if v.is_a?(Hash)
# v.each do |k, v|
# parse v
# p "#{k v}"
# end
@wojkos
wojkos / main.rb
Created November 14, 2018 09:57
FarawayDistortedUsernames created by wojkos - https://repl.it/@wojkos/FarawayDistortedUsernames
text = {:user=>{:first_name=>["must be filled"], :email_address=>["Wrong email format"], :phone_number=>["Wrong phone number format. Use only digits with + on begining"], :address_attributes=>{:street=>["must be filled"], :city=>["must be filled"], :zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}, :company_attributes=>{:address_attributes=>{:zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}}}}
# def parse v
# if v.is_a?(Hash)
# v.each do |k, v|
# parse v
# p "#{k v}"
# end