Skip to content

Instantly share code, notes, and snippets.

Avatar

Георгий У. georgy7

View GitHub Profile
@georgy7
georgy7 / beer.asm
Last active Jan 17, 2021
It's flat assembler (FASM). Re-uploaded. It used to be in the w32utils repository (April 2018).
View beer.asm
; 99 Bottles of Beer
; ------------------
format PE console 4.0
entry start
include 'win32a.inc'
include 'macro/if.inc'
View training_generator_example.py
#!/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 Aug 18, 2018
Карточка для родословной в MediaWiki
View ExampleUsage
{{Персона
| birthday = 1 января 1970
| birthplace = Новосибирск
| photo = [[Файл:Старое_фото.jpg]]
| mother = [[Полное Имя|Кратко]]
| father = [[Полное Имя|Кратко]]
| spouse = [[Полное Имя|Кратко]]
| siblings =
<ul>
View gist:ade186facd48a6f6f8693ab429dc51c1
#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 Nov 15, 2017
flat assembler Windows (PE) CLI HelloWorld
View hello2.asm
format pe CONSOLE 4.0
entry start
include 'win32a.inc'
stdin = -10
stdout = -11
stderr = -12
@georgy7
georgy7 / bashtar.sh
Last active Sep 27, 2017
It's like a resource builder. Or the simplest tar alternative ever. If you do not want to bloat your demo executable.
View bashtar.sh
#!/usr/bin/env bash
# Сверхупрощенная (в плане разбора) замена TAR.GZ.
# Первая строка - кол-во файлов (N).
# Следующие N строк - названия и размеры файлов через TAB.
# Дальше файлы идут подряд.
FILES_TO_CONCATENATE=(
"file1.bmp"
@georgy7
georgy7 / .gitignore
Created May 6, 2017
Статьи с тегами. Тестовые данные для бенчмарков.
View .gitignore
.idea
.directory
data
View exceptionSample1.d
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 Mar 2, 2017
Factorial approximation
View flog.d
/// 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 Feb 28, 2017
D executable size experiment.
View dzip.d
/++
+ 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)