Skip to content

Instantly share code, notes, and snippets.

View aolo2's full-sized avatar

Алексей Олохтонов aolo2

View GitHub Profile
#include <pty.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <tcl8.6/expect.h>
\documentclass[14pt, a4paper]{extarticle}
\RequirePackage[l2tabu, orthodox]{nag}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage[top=2cm, bottom=2cm, left=3cm, right=1cm]{geometry} % Отступы
\usepackage{fontspec}
\usepackage{amsmath, amssymb, indentfirst, titletoc, titlesec, verbatim, csquotes, tabularx, listings, caption, url, tocloft, graphicx, multirow, courier}
@aolo2
aolo2 / Makefile
Created June 12, 2019 11:46
приятный makefile
APP_NAME = opt
LIB_NAME = spirvopt
MODE = Debug
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic -Wno-unused-function
BUILD_PATH = build/debug
ifeq ($(MODE), Release)
#define GLFW_INCLUDE_VULKAN
#define NUM_SAMPLES VK_SAMPLE_COUNT_1_BIT
#define NUM_DESCRIPTOR_SETS 1
#define NUM_SHADER_STAGES 2
#define NUM_VERT_ATTRIBUTES 2
#define NUM_VIEWPORTS 1
#define NUM_SCISSORS NUM_VIEWPORTS
#define FENCE_TIMEOUT 100000000
#include "common.h"
# Git branch in prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1) /'
}
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;33m\]\$(parse_git_branch)\[\033[00m\]$ "
static void
m3_unity(f32 result[static 9])
{
memset(result, 0x00, 9 * sizeof(f32));
result[0] = result[4] = result[8] = 1.0f;
}
static void
m3_mul(f32 result[static 9], f32 A[static 9], f32 B[static 9])
static s32
orient_2d(s32 ax, s32 ay, s32 bx, s32 by, s32 x, s32 y)
{
return(bx - ax) * (y - ay) - (by - ay) * (x - ax);
}
static void
fill_triangle(struct framebuffer *fb,
s32 v0x, s32 v0y, s32 v1x, s32 v1y, s32 v2x, s32 v2y)
{
// [INFO] Average time ~ 16.1 msec (10k triangles)
#include "../../common.h"
#if VIS
#include <GL/glew.h>
#include <GLFW/glfw3.h>
struct GL {
GLuint VAO;
@aolo2
aolo2 / t.c
Last active May 20, 2019 12:14
SDL2 pixmap fast drawing skeleton
#include "common.h"
#include <SDL.h>
static const u32 WINDOW_WIDTH = 800;
static const u32 WINDOW_HEIGHT = 600;
static const u32 TARGET_FRAMERATE = 60;
static const f32 TARGET_FRAMETIME = 1000.0f / (f32) TARGET_FRAMERATE;
@aolo2
aolo2 / inspector.css
Last active May 10, 2019 13:10
readable internet
body {
background: #eee;
padding: 5em;
font-family: Roboto;
line-height: 1.6;
}
pre {
background: white;
padding: .5em;