Skip to content

Instantly share code, notes, and snippets.

View georgy7's full-sized avatar

Георгий У. georgy7

View GitHub Profile
@georgy7
georgy7 / beer.asm
Last active January 17, 2021 20:27
It's flat assembler (FASM). Re-uploaded. It used to be in the w32utils repository (April 2018).
; 99 Bottles of Beer
; ------------------
format PE console 4.0
entry start
include 'win32a.inc'
include 'macro/if.inc'
#!/usr/bin/env python3
import os
from PIL import Image, ImageFilter
from enum import Enum
import random
import numpy as np
import tensorflow as tf
@georgy7
georgy7 / ExampleUsage
Last active August 18, 2018 21:29
Карточка для родословной в MediaWiki
{{Персона
| birthday = 1 января 1970
| birthplace = Новосибирск
| photo = [[Файл:Старое_фото.jpg]]
| mother = [[Полное Имя|Кратко]]
| father = [[Полное Имя|Кратко]]
| spouse = [[Полное Имя|Кратко]]
| siblings =
<ul>
@georgy7
georgy7 / gist:ade186facd48a6f6f8693ab429dc51c1
Created December 6, 2017 15:52 — forked from aqiank/gist:efa6eefcc81157982acc
SDL2 DropEvent minimal example
#include <SDL2/SDL.h>
int main() {
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window *window = SDL_CreateWindow("Drag-and-Drop", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN);
int running = 1;
while (running) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
@georgy7
georgy7 / hello2.asm
Last active November 15, 2017 16:14
flat assembler Windows (PE) CLI HelloWorld
format pe CONSOLE 4.0
entry start
include 'win32a.inc'
stdin = -10
stdout = -11
stderr = -12
@georgy7
georgy7 / bashtar.sh
Last active September 27, 2017 15:58
It's like a resource builder. Or the simplest tar alternative ever. If you do not want to bloat your demo executable.
#!/usr/bin/env bash
# Сверхупрощенная (в плане разбора) замена TAR.GZ.
# Первая строка - кол-во файлов (N).
# Следующие N строк - названия и размеры файлов через TAB.
# Дальше файлы идут подряд.
FILES_TO_CONCATENATE=(
"file1.bmp"
@georgy7
georgy7 / .gitignore
Created May 6, 2017 12:17
Статьи с тегами. Тестовые данные для бенчмарков.
.idea
.directory
data
bool read = false;
int tries = 0;
while (!read && tries < 5) {
try {
if (wrongFoot) {
throw new GotUpOnTheWrongFoot();
}
// Yes, I really doesn't care if something
// much deeper in it throws the exception.
@georgy7
georgy7 / flog.d
Last active March 2, 2017 16:39
Factorial approximation
/// License: CC0
import std.math;
real flog10(long n) {
real r = 0;
foreach (i; 1..(n+1)) {
r += log10(i);
}
return r;
@georgy7
georgy7 / dzip.d
Created February 28, 2017 11:08
D executable size experiment.
/++
+ Experiment 2017-02-28.
+ Author: Георгий Устинов
+ License: CC0.
+
+ Executable size on Linux x86_64
+ LDC2 0.17.1 (DMD v2.068.2, LLVM 3.8.0)
+
+ ldc2 dzip.d ............... 26.6 KiB (27 232)
+ ldc2 -release dzip.d ...... 26.5 KiB (27 176)