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
@JBlackCat
JBlackCat / linear-vert-gradient.glsl
Last active October 16, 2024 19:44
Linear Vertical Gradient Fragment Shader
uniform vec4 u_gradient_color_1;//#fa67ba
uniform vec4 u_gradient_color_2;//#b17ff5
uniform float u_gradient_alpha_color_1;//0:1:0.53
uniform float u_gradient_alpha_color_2;//0:1:1.00
uniform float u_gradient_location_color_1;//0:1:0.00
uniform float u_gradient_location_color_2;//0:1:0.96
vec4 LinearVertGradient(float yCoord, vec4 color_1, float alpha_color_1, float location_color_1, vec4 color_2, float alpha_color_2, float location_color_2) {
@laobubu
laobubu / ABOUT.md
Last active March 12, 2025 21:04
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@Flix01
Flix01 / imguiverticaltext.h
Created June 23, 2016 17:23
ImDrawList methods to display vertical text in ImGui
#pragma once
#include <imgui.h>
#include <imgui_internal.h>
// ImDrawList methods to display vertical text
/*
// TEST: inside a window:
ImGuiWindow* window = ImGui::GetCurrentWindow();
ImDrawList* dl = window->DrawList;
#pragma once
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
namespace ImGui
{
inline void SetupImGuiStyle( bool bStyleDark_, float alpha_ )
{
@hb3p8
hb3p8 / ImGuiHandler.cpp
Created January 29, 2016 08:33
ImGui OSG wrapper
#include <ImGuiHandler.hpp>
#include <imgui/imgui.h>
#include <iostream>
using namespace sf;
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
// If text or lines are blurry when integrating ImGui in your engine:
@thennequin
thennequin / ColorPicker.cpp
Created December 22, 2015 11:25
Color picker
bool ColorSelector(const char* pLabel, ImVec4& oRGBA)
{
const ImU32 c_oColorGrey = ImGui::ColorConvertFloat4ToU32(ImVec4(0.75f,0.75f,0.75f,1.f));
const ImU32 c_oColorBlack = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,1.f));
const ImU32 c_oColorBlackTransparent = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,0.f));
const ImU32 c_oColorWhite = ImGui::ColorConvertFloat4ToU32(ImVec4(1.f,1.f,1.f,1.f));
ImGui::PushID(pLabel);
bool bRet = false;
ImGuiID iID = ImGui::GetID(pLabel);
@Lanchon
Lanchon / stm32cubemx-linux.md
Last active September 5, 2024 11:06
Installing STM32CubeMX on Linux

Installing STM32CubeMX on Linux

The STM32CubeMX tool is written in portable java, but unfortunately it is distributed as a Windows executable embedded in a Windows installer.

To install it on Linux:

  1. sudo java -jar SetupSTM32CubeMX-4.11.0.exe
  2. install the tool somewhere in your home, eg: /home/you/stm32/cubemx
  3. sudo chown -R you:you /home/you/stm32/cubemx
@thennequin
thennequin / DisplayInImGui.cpp
Last active November 16, 2022 16:00
Ini Config Reader/Writer
Ini::IniConfig& m_oIniConfig;
Ini::CategoryValueMap& mCategories = m_oIniConfig.GetCategories();
if (ImGui::Button("Reload"))
{
m_oIniConfig.Load("Config.ini", true, false);
}
ImGui::SameLine();
if (ImGui::Button("Save"))
@mhitza
mhitza / Makefile
Last active March 24, 2025 09:27
Programming Arduino Uno (ATmega386P) in assembly
%.hex: %.asm
avra -fI $<
rm *.eep.hex *.obj *.cof
all: $(patsubst %.asm,%.hex,$(wildcard *.asm))
upload: ${program}.hex
avrdude -c arduino -p m328p -P /dev/arduino-uno -b 115200 -U flash:w:$<
monitor:
@simlun
simlun / raspi-monitor
Last active June 9, 2024 15:15
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