Skip to content

Instantly share code, notes, and snippets.

View dolohow's full-sized avatar

Łukasz Żarnowiecki dolohow

View GitHub Profile
@dolohow
dolohow / paranthesis_parser.py
Created February 18, 2019 10:21
Parenthesis parser
def parse(string):
tokens = []
for char in string:
try:
if char == '(':
tokens.append('(')
elif char == '[':
tokens.append('[')
elif char == ']':
if tokens.pop() != '[':
@dolohow
dolohow / ctest.txt
Last active February 19, 2019 00:16
Oracle test for Solaris team
> 1) Write a C (C99) program which reads a standard input and prints each line in reversed order. Assume '\n' as line separator. Do not assume limit of number of character per line. Example:
>
> $ printf "123\nhello\n" | ./a.out
> 321
> olleh
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@dolohow
dolohow / usa.py
Created January 6, 2020 16:42
Price of importing car in USA
from pylab import *
car_price_from_auction = list(range(0, 10001, 500))
dollar_cost = 3.97
euro_cost = 4.39
euro_to_dollar = 1.11
pln_to_usd = 0.25
def total_cost(car_price_from_auction):
@dolohow
dolohow / gist:f80b33f4ac908ea7ab40e55a27a21f61
Last active April 28, 2022 11:31
rapiddc.pl VPS.Pico benchmark
Thu Apr 28 13:17:18 CEST 2022
Basic System Information:
---------------------------------
Processor : Common KVM processor
CPU cores : 2 @ 1999.999 MHz
AES-NI : ❌ Disabled
VM-x/AMD-V : ❌ Disabled
RAM : 1.6 GiB
Swap : 2.0 GiB
@dolohow
dolohow / gist:aa273fbf558ca86a4036a7869d2e3837
Created May 14, 2020 19:34
digitalocean $5 droplet germany
Basic System Information:
---------------------------------
Processor : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
CPU cores : 1 @ 2294.608 MHz
AES-NI : ✔ Enabled
VM-x/AMD-V : ✔ Enabled
RAM : 989Mi
Swap : 0B
Disk : 25G
@dolohow
dolohow / gist:bd8462b63b661f8d4bd7cbc291310b4d
Created May 15, 2020 17:18
virmach.com Value+ benchmark
Basic System Information:
---------------------------------
Processor : QEMU Virtual CPU version (cpu64-rhel6)
CPU cores : 1 @ 3399.998 MHz
AES-NI : ❌ Disabled
VM-x/AMD-V : ❌ Disabled
RAM : 487M
Swap : 511M
Disk : 9.4G
Sun 17 May 2020 02:21:25 PM EDT [10/9229]
Basic System Information:
---------------------------------
Processor : AMD Ryzen 7 3700X 8-Core Processor
CPU cores : 1 @ 3593.250 MHz
AES-NI : ✔ Enabled
import curses
import pdb
import random
import time
from curses import wrapper
GAME_BOARD_SIZE = (20, 20)
@dolohow
dolohow / main.py
Created October 27, 2020 16:44
wp_merge
"""
This module combines input from CSV file with API endpoint data and outputs
result to CSV file.
Example:
Usage:
$ wpe_merge input_csv_file output_csv_file
To show help use:
@dolohow
dolohow / delete.py
Last active March 4, 2023 14:19
Delete old telegram bot messages from group chat and user commands
#!/usr/bin/python
# Prerequisities
# pip install pyrogram tgcrypto
from datetime import datetime
from pyrogram import Client
# Configure here