Skip to content

Instantly share code, notes, and snippets.

View aolo2's full-sized avatar

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

View GitHub Profile
python
# GDB dashboard - Modular visual interface for GDB in Python.
#
# https://github.com/cyrus-and/gdb-dashboard
import ast
import os
import re
import struct
CUSTOM_UI_COMMAND_SIG(jump_to_definition_at_cursor)
CUSTOM_DOC("Jump to the first definition in the code index matching an identifier at the cursor")
{
View_ID view = get_active_view(app, Access_Visible);
if (view != 0){
Scratch_Block scratch(app);
String_Const_u8 query = push_token_or_word_under_active_cursor(app, scratch);
@aolo2
aolo2 / bdf.c
Last active July 9, 2021 18:03
#define BDF_MAX_LINE_LENGTH 1024
#define BDF_GLYPH_SELF_OFFSET_X 0
#define BDF_GLYPH_SELF_OFFSET_Y 1
#define BDF_GLYPH_NEXT_OFFSET_X 2
#define BDF_GLYPH_NEXT_OFFSET_Y 3
struct bdf_header {
/* FONT */
u32 version_major;
u32 version_minor;
@aolo2
aolo2 / bfs.cpp
Created September 27, 2020 16:41
Ужасная (но рабочая!) попытка multiGPU
int main(int argc, char **argv)
{
try
{
double t1 = omp_get_wtime();
// считываем параметры командной сторки
int scale = 12;
int avg_degree = 15;
string graph_type = "rmat";
bool check = true;
@aolo2
aolo2 / ttf.c
Created July 25, 2020 21:18
read ttf font_directory
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <arpa/inet.h>
#define READ_BE32(buf) htonl(*(u32 *)(buf->data + buf->offset)); buf->offset += 4
#define READ_BE16(buf) htons(*(u16 *)(buf->data + buf->offset)); buf->offset += 2
// main.cpp
#include "tracy/Tracy.hpp"
#include <unistd.h>
int main(void) {
ZoneScoped;
sleep(1);
}
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <assert.h>
#include <omp.h>
#include <emmintrin.h>
dashboard -layout expressions source assembly
dashboard source -style context 20
dashboard -style syntax_highlighting 'monokai'
alias wt1 = dashboard expression watch
alias wt0 = dashboard expression unwatch
alias wt00 = dashboard expression clear
#include <mpi.h> /* MPI, duh... */
#include <stdio.h> /* printf, fprintf, file-IO */
#include <stdint.h> /* fixed-size types */
#include <stdlib.h> /* malloc, atoi */
#include <string.h> /* memset */
#include <math.h> /* sqrtf */
#define MASTER 0
#define ZERO '.'
#define ONE 'o'
@aolo2
aolo2 / hc0_linux.c
Created December 7, 2019 12:15
halcyon with kb
#pragma once
/* Halcyon ZERO (single-header video-only) -- Linux */
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <string.h>
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>