Skip to content

Instantly share code, notes, and snippets.

View mmasztalerczuk's full-sized avatar

Mariusz Masztalerczuk mmasztalerczuk

View GitHub Profile
import sys
data = []
for l in sys.stdin.readlines():
cmd, val = l[:-1].split(' ')
data.append((cmd, int(val)))
def calculate_part_1(data):
x, y = 0, 0
for cmd, val in data:
import sys
p = None
a = 0
data_val = []
def calculate_inc(data):
a = 0
p = None
for d in data:
s = 0
e = 100
while True:
print(f"Czy to jest {(s+e)//2}")
cmd = input()
if cmd == "M":
e = (s+e)//2
elif cmd == "W":
s = (s+e)//2
import random
ans = 0
p = 0
dmg = 1
t = 13
def hit(t):
global ans, p
a = random.randint(1, 20)
if a >= t:
ans += 12
>>> l
['1234', '5678']
>>> [sum(x) for x in [map(int, list(x)) for x in l]]
[10, 26]
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject",
@mmasztalerczuk
mmasztalerczuk / .gitlab-ci.yml
Last active January 20, 2022 20:02
Example gitlab-ci yaml
image: node:8.12.0-alpine
cache:
paths:
- node_modules/
variables:
AWS_DEFAULT_REGION: us-east-2
BUCKET_NAME: test55555
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::mytest55555/*"
}
@mmasztalerczuk
mmasztalerczuk / Pipfile.lock (fragment)
Created March 6, 2018 20:51
Example of Pipfile.lock (only part of)
{
"_meta": {
"hash": {
"sha256": "7ff1d75419cc3d2fa4c2f706969f15a7137e5f3ef364febeb91a8667e523a7f3"
},
"host-environment-markers": {
"implementation_name": "cpython",
"implementation_version": "3.6.3",
"os_name": "posix",
"platform_machine": "x86_64",
@mmasztalerczuk
mmasztalerczuk / Pipfile
Created March 6, 2018 20:49
Example Pipfile
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
pytest = "*"