Skip to content

Instantly share code, notes, and snippets.

View bausk's full-sized avatar

Oleksander Bausk bausk

View GitHub Profile
https://colab.research.google.com/github/mrdbourke/simple-local-rag/blob/main/00-simple-local-rag.ipynb
@bausk
bausk / gist:d435e58679ab891353b479a527587ac8
Created February 27, 2025 12:35
generate_test_csv.py
#!/usr/bin/env python3
import argparse
import csv
import random
import string
import sys
from datetime import datetime, timedelta
from faker import Faker
def parse_size(size_str):
@bausk
bausk / clean_code_reading_notes.md
Last active January 14, 2020 21:49
Clean Code by Robert Martin - Reading Notes

How to Use

These are my reading notes for the classic software engineering book, Clean Code.
They were compiled back in 2017, before I took up a habit of making consistent abridged notes for major long-form stuff I read; therefore they are very short. Use at your own discretion.

Clean Code

  • Monadic forms: question, transformation, and event.
  • Avoid argument flags
  • Dependency magnet - how to deal with them?
@bausk
bausk / ddia_reading_notes.md
Last active January 14, 2020 21:11
Designing Data-Intensive Applications: Abridged Notes

How to Use

I compiled these to remind myself of the parts of the DDIA book I found especially useful or important. If you have as bad a memory as I do, you might find these helpful. These reading notes are meant to provide a searchable index of crucial terms and definitions in the book. They do not indend to replace the actual reading but can be helpful if you need to understand which pages to look for or get a quick refresher. Numbers at line ends represent pages. Descriptors like "all", "no" etc. are for brevity and often mean "in vast majority of practical cases", use at your own discretion.

Designing Data-Intensive Applications

RELIABILITY is about building fault-tolerant systems from unreliable parts. (6)
Systematic errors - software bugs that arise from assuming properties about environment (8)
Human errors - main factor; sandboxing, restrictions, testing, recovery, telemetry (9)
SCALABILITY: ability of a system to handle increased load (10)

<?xml version="1.0"?>
<urlset xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://snapbook.com/af-en</loc>
<lastmod>2019-04-26T00:00:00+00:00</lastmod>
<changefreq>weekly</changefreq>
<link href="https://snapbook.com/af-ar" rel="alternate" hreflang="ar-AF" xmlns="http://www.w3.org/1999/xhtml" />
<link href="https://snapbook.com/af-uk" rel="alternate" hreflang="uk-AF" xmlns="http://www.w3.org/1999/xhtml" />
<link href="https://snapbook.com/af-ru" rel="alternate" hreflang="ru-AF" xmlns="http://www.w3.org/1999/xhtml" />
<link href="https://snapbook.com/al-en" rel="alternate" hreflang="en-AL" xmlns="http://www.w3.org/1999/xhtml" />

Keybase proof

I hereby claim:

  • I am bausk on github.
  • I am bausk (https://keybase.io/bausk) on keybase.
  • I have a public key ASDvm6RHRiUJVSf_GUL04h8RHWVD59Ch5bzEAMoaSoKAGwo

To claim this, I am signing this object:

@bausk
bausk / verywebscale.js
Created January 25, 2019 13:38
Modify code so that gethandler fires immediately after GET finishes, puthandler fires immediately after PUT finishes, and both receive correct inputs
const getrequest = Promise.resolve('GET').then((res) => {
console.log(`in put constructor: get response was ${res}`);
return new Promise((resolve) => {
setTimeout(() => {
resolve('PUT');
}, 3000);
});
});
const puthandler = (res) => {
{
"created_at": "Tue Jan 10 23:23:27 +0000 2017",
"hashtags": [
{
"text": "converse"
}
],
"id": 818961482910203904,
"lang": "en",
"media": [
@bausk
bausk / django-upload-file-metadata.py
Created September 30, 2016 12:12
Upload Django file with metadata
"""Запрос, который отсылает данные:
(Файл C:/1.png и адрес /users/api/example/ заменить на нужные)
curl -vvv -X POST -H "Content-Type:multipart/form-data" -H "Accept:application/json" -F "hello=1" -F "key=metadata2" -F "image=@C:/1.png" http://127.0.0.1:8000/users/api/example/
"""
class ExampleView(APIView):
"""
A view that can accept POST requests with JSON content.
"""