Skip to content

Instantly share code, notes, and snippets.

@TheVice
TheVice / 09_shader_base.frag
Created November 14, 2022 22:30
This sample contain code original described at the video "Vulkan is HARD" 03.09.2022 https://www.youtube.com/watch?v=XGmVrjbFVm0 by @lolzdev. Any not visible parts took from next source file - https://github.com/Overv/VulkanTutorial/raw/87803541171579165caa354120157a0cc6c8192f/code/15_hello_triangle.cpp. Shaders, that was not described in the vi…
#version 450
layout(location = 0) in vec3 fragColor;
layout(location = 0) out vec4 outColor;
void main() {
outColor = vec4(fragColor, 1.0);
}
@TheVice
TheVice / brackets.cpp
Created November 14, 2022 22:18
Sample that check input string on opened and closed brackets.
/*
* The MIT License (MIT)
*
* Copyright (c) 2022 https://github.com/TheVice/
*
*/
#include <list>
#include <string>
#include <utility>
@TheVice
TheVice / CMakeLists.txt
Last active February 23, 2022 07:24
Fork of sources (C++) from book "Grokking Algorithms (2016) by Aditya Bhargava" created while study. Author of original sources - Aditya Bhargava @egonSchiele, https://adit.io/
cmake_minimum_required(VERSION 2.8.12)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Configuration process cannot start from project source directory.")
endif()
project("Aditya Bhargava - Grokking Algorithms(2016)")
add_executable(ch01_binary_search "${CMAKE_SOURCE_DIR}/ch01_binary_search.cpp")
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 https://github.com/TheVice/
*
*/
/*
* References.
* https://devblogs.microsoft.com/oldnewthing/20101018-00/?p=12513
@TheVice
TheVice / CMakeLists.txt
Last active February 24, 2019 21:53
Tool allow to install service for specific user. If it do not exists it will be created as regular and required right for run service will be granted. Password will be generated that meet policy at Windows Server.
cmake_minimum_required(VERSION 2.8.12)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Configuration process cannot start from project source directory.")
endif()
project("Windows_Service")
add_executable(service "${CMAKE_SOURCE_DIR}/service.c")
@TheVice
TheVice / CMakeLists.txt
Last active March 8, 2019 20:43
git_extractor – tool that browse repository at specific revision and save all files from that state to output path. Sample using: ‘git_extractor <path to repository> <hash of commit> <output path>’.
cmake_minimum_required(VERSION 3.8)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Configuration process cannot start from project source directory.")
endif()
project("git_extractor")
if(DEFINED ENV{LIBGIT2_PATH})
@TheVice
TheVice / BuildVistaButtonFactory.cs
Last active November 12, 2018 21:43
Starting from Windows 8 theme of WPF button by default flat. If require Vista theme, a.k.a. Chrome decorator, at Windows 8 and up theme can be apply by next approach.
/*
*
* The MIT License (MIT)
*
* Copyright (c) 2018 https://github.com/TheVice/
*
* As reference used program samples
* BuildButtonFactory from chapter 11 - "Single-Child Elements" of "Applications = Code + Markup" by Charles Petzold (2006) (ISBN 978-0-7356-1957-9)
* and
* ControlTemplateBrowser from chapter 15 - "Control Templates" at "Dissecting Controls" section of
@TheVice
TheVice / CMakeLists.txt
Created August 31, 2018 22:52
Fork of "Pluralsight - Direct2D Fundamentals(2012) by Kenny Kerr" created while study. Information and video tutorial - http://www.pluralsight.com/courses/direct2d-fundamentals Author - @kennykerr, http://kennykerr.ca, https://github.com/kennykerr
cmake_minimum_required(VERSION 2.8.12.2)
project("Pluralsight - Direct2D Fundamentals (2012)")
set(READY_TO_BUILD FALSE)
# Request Visual Studio
if(MSVC)
# Request Visual Studio 2012+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 16.0)
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 https://github.com/TheVice/
*
*/
using System;
using System.IO;
#if !NET20
@TheVice
TheVice / IsWindowsVersionOrGreater.asm
Last active September 24, 2019 20:05
This is an extension of VersionHelpers.h that come with Visual Studio 2013 and above. As in original manifest file in application should be present for work check of Windows 8.1 and above - https://blogs.msdn.microsoft.com/chuckw/2013/09/10/manifest-madness/ .
; The MIT License (MIT)
; Copyright (c) 2017 https://github.com/TheVice/
; 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