Skip to content

Instantly share code, notes, and snippets.

View andreyst's full-sized avatar

Andrey Stolbovsky andreyst

View GitHub Profile
@andreyst
andreyst / _
Last active October 31, 2025 00:04
Установка iMovie и первые шаги
We couldn’t find that file to show.
@andreyst
andreyst / gist:c5dd7e439add120f3bcbeea5d4943520
Created October 18, 2025 21:39
Life in the UK prep custom instructions prompts
What I’d like you to know about me
I’m preparing for the Life in the UK Test. I’m not from the UK, so many facts (especially dates, names, and acts of parliament) feel random. I learn best with clear, plain-English explanations first, then memory aids (mnemonics, stories, patterns), and lots of active-recall practice. Please help me understand why an answer is correct and how to remember it quickly under test pressure.
How I’d like you to respond
1. Teaching style
• Start with a 2–3 sentence overview in plain English, then expand only as needed.
• Prefer patterns over trivia: show timelines, clusters (by century/theme), and cause→effect links.
• When a fact looks random, build a mnemonic or micro-story for me (acronyms, rhymes, chunking, number-shape/peg system, PAO if helpful).
@andreyst
andreyst / sqlite-tx-test.go
Created February 14, 2021 08:10
sqlite dirty reads
package main
/*
Following program tries to exhibit dirty reads
in SQLite by writing and reading in 2 tx
from single connection.
It does not succeed and I'm trying to understand why.
I would expect TX 2 read value = 1 as per
https://sqlite.org/isolation.html.
# What am I trying to is to have a directory from docker host as a volume
# on my logstashforwarder container as /logs/weblogs. The directory itself
# is a volume from weblogs container.
# The directory name is /mnt/sda1/var/lib/docker/vfs/dir/df7348dc27f7b45f3e6827527bd9bba0d597a5619a5efea386829e5c7d279089.
$ fig --version
fig 1.0.1
$ docker -v
Docker version 1.4.1, build 5bc2ff8
$("body").find(".course-item-list-section-list").each(function(num, el) { var linksTexts = $(el).find(".lecture-link").text(); var match = linksTexts.match(/\d+ min\)/g); var i = 0, k, totalDuration = 0; for (i = 0; i < match.length; i++) { totalDuration += parseInt(match[i]); }; $(el).prev().text($(el).prev().text() + " (" + totalDuration + " mins)"); })
<?php
declare(ticks = 1); // needed
function sig_handler($signo) {
echo "Caught $signo...\n";
}
pcntl_signal(SIGUSR1, "sig_handler");
echo 'Hi!' . PHP_EOL;