Skip to content

Instantly share code, notes, and snippets.

View colesnicov's full-sized avatar

Colesnicov Denis Petrovich colesnicov

  • Czech Republic, Tachov
View GitHub Profile
@colesnicov
colesnicov / CMakeLists.txt
Created April 18, 2022 16:09
Jak vkladat Kconfig soubory
set(ENV{PROJ_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
@colesnicov
colesnicov / newPager.js
Last active September 25, 2022 18:13
HTML Paginator in pure JS
/*
The MIT License
Copyright 2022 Denis Colesnicov.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@colesnicov
colesnicov / queue.js
Created October 11, 2022 20:37
javascript implementation of queue with extended functionality
/*
* The MIT License
*
* Copyright 2022 denis.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@colesnicov
colesnicov / kmstest.c
Created May 14, 2024 12:55 — forked from dvdhrm/kmstest.c
DRM KMS Test
#define EGL_EGLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <errno.h>
#include <gbm.h>
#include <GL/gl.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <stdlib.h>
@colesnicov
colesnicov / totp.c
Created May 22, 2024 19:38 — forked from Flix01/totp.c
totp.c
// Original code: https://gist.github.com/syzdek/eba233ca33e1b5a45a99
// Original code license:
/*
* TOTP: Time-Based One-Time Password Algorithm
* Copyright (c) 2015, David M. Syzdek <david@syzdek.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
#include <filesystem>
#include <imgui.h>
#define BIT(x) (1 << x)
std::pair<bool, uint32_t> DirectoryTreeViewRecursive(const std::filesystem::path& path, uint32_t* count, int* selection_mask)
{
ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth;
bool any_node_clicked = false;
@colesnicov
colesnicov / rpi-hdmi.sh
Created June 9, 2024 15:14 — forked from AGWA/rpi-hdmi.sh
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
@colesnicov
colesnicov / raspi-monitor
Created June 9, 2024 15:15 — forked from simlun/raspi-monitor
Script to enable and disable the HDMI signal of the Raspberry PI
#!/bin/bash -e
# /usr/local/sbin/raspi-monitor
# Script to enable and disable the HDMI signal of the Raspberry PI
# Inspiration: http://www.raspberrypi.org/forums/viewtopic.php?t=16472&p=176258
CMD="$1"
function on {
/opt/vc/bin/tvservice --preferred