Skip to content

Instantly share code, notes, and snippets.

View dmitrykolesnikovich's full-sized avatar

Dmitry Kolesnikovich dmitrykolesnikovich

View GitHub Profile
@dmitrykolesnikovich
dmitrykolesnikovich / 4lKXWD.glsl
Created January 1, 2021 17:50
Animated selection rectangle
// https://www.shadertoy.com/view/4lKXWD
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord.xy / iResolution.xy;
// rect boundaries
vec2 rectMin = vec2(0.4, 0.2);
vec2 rectMax = vec2(0.8, 0.8);
// some people prefer "min + (max - min) / 2", but for floating point UV space it
@dmitrykolesnikovich
dmitrykolesnikovich / artifact.groovy
Last active January 31, 2021 12:25
featurea gradle interop
// featurea gradle interop
void artifact(String artifactId, Closure projects) {
String artifactPath = projects()
File artifactDir = new File(artifactPath)
if (!artifactDir.exists()) throw new RuntimeException("Artifact not found: ${artifactDir.absolutePath}")
def includeProject = { File projectFile, String specifier = null ->
if (!projectFile.exists()) return
File projectDir = projectFile.parentFile
@dmitrykolesnikovich
dmitrykolesnikovich / gw.sh
Last active January 31, 2021 19:45
My Very Own Gradle Wrapper
function gw() {
path="$1"
command="$2"
if [ "$command" == "test" ]
then
path="${path}-tests"
command="run"
fi
<Mnemoschema id="1floor_S" position="-1.0, 0.0" size="681,1400" backgroundColor="#FFFFFF00" backgroundImage="/Users/dmitrykolesnikovich/Documents/Home23-download/фон_смартфон7.jpg" saveAspectRatio="false" transition="screen">
<BackButton image="/Users/dmitrykolesnikovich/Documents/Home23-download/back2.png" name="Назад" position="31.0, 1292.0" size="93.0, 96.0" saveAspectRatio="true" backgroundColor="#00000000"/>
<NavigationButton transition="screen" form="Свет1эт" font="font:/Palatino Linotype_48_Bold_" color="#000000FF" url="https://www.l-control.com.ua" imageUp="/Users/dmitrykolesnikovich/Documents/Home23-download/текст картинки/светUp.png" imageDown="/Users/dmitrykolesnikovich/Documents/Home23-download/текст картинки/светDown.png" name="Свет" position="158.0, 1309.0" size="173.0, 55.0" saveAspectRatio="false" backgroundColor="#00000000"/>
<Mnemoschema link="light_1floor" name="Свет1эт" position="55.0, 0.0"/>
<NavigationButton transition="screen" form="Климат 1эт" font="fon
@dmitrykolesnikovich
dmitrykolesnikovich / ChipsView.kt
Created March 21, 2021 15:30 — forked from adavis/ChipsView.kt
A function to programmatically add views to ConstraintLayout with Flow
class ChipsView<T : Parcelable>(ctx: Context, attr: AttributeSet) : ConstraintLayout(ctx, attr) {
...
private fun addSubviews() {
val flow = Flow(context).apply {
id = generateViewId()
setWrapMode(Flow.WRAP_CHAIN)
setHorizontalStyle(Flow.CHAIN_PACKED)
setHorizontalAlign(Flow.HORIZONTAL_ALIGN_START)
setHorizontalBias(0f)
img.clean {
border: 0px;
border-radius: 0px;
}
video {
position:relative;
display: block;
margin: 0px;
padding: 0px;
@dmitrykolesnikovich
dmitrykolesnikovich / test.cpp
Created September 1, 2021 09:49
directx example for windows
#include <Windows.h>
#include <d3d12.h>
#include <dxgi1_6.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#pragma comment(lib, "d3d12.lib")
This file has been truncated, but you can view the full file.
[test10_1_station] [27.10.2021 11:31:10.397] Connect 178.212.193.121:530
[test10_1_station] [27.10.2021 11:31:10.792] send [0, 1, 0, 0, 0, 6, 1, 3, 0, 1, 0, 10]
[test10_1_station] [27.10.2021 11:31:10.795] recv (178.212.193.121:530) [0, 1, 0, 0, 0, 23, 1, 3, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[test10_1_station] [Response Time] [27.10.2021 11:31:10.893] 178.212.193.121:530/1/Holdings/1..10: 3ms
[test10_1_station] [27.10.2021 11:31:10.893] Read succeed channels 178.212.193.121:530/1/Holdings/1..10
[test10_1_station] Read Channel 1: 0.0 (300.0ms)
[test10_1_station] Read Channel 2: 0.0 (300.0ms)
[test10_1_station] Read Channel 3: 0.0 (300.0ms)
[test10_1_station] Read Channel 4: 0.0 (300.0ms)
[test10_1_station] Read Channel 5: 0.0 (300.0ms)
This file has been truncated, but you can view the full file.
[test10_2_station] [27.10.2021 11:31:14.376] Connect 178.212.193.121:530
[test10_2_station] [27.10.2021 11:31:14.769] send [0, 1, 0, 0, 0, 6, 1, 3, 0, 1, 0, 10]
[test10_2_station] [27.10.2021 11:31:14.773] recv (178.212.193.121:530) [0, 1, 0, 0, 0, 23, 1, 3, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[test10_2_station] [Response Time] [27.10.2021 11:31:14.869] 178.212.193.121:530/1/Holdings/1..10: 4ms
[test10_2_station] [27.10.2021 11:31:14.869] Read succeed channels 178.212.193.121:530/1/Holdings/1..10
[test10_2_station] Read Channel 1: 0.0 (300.0ms)
[test10_2_station] Read Channel 2: 0.0 (300.0ms)
[test10_2_station] Read Channel 3: 0.0 (300.0ms)
[test10_2_station] Read Channel 4: 0.0 (300.0ms)
[test10_2_station] Read Channel 5: 0.0 (300.0ms)
@dmitrykolesnikovich
dmitrykolesnikovich / lcontrolcloud-3-11-31.log
Created October 27, 2021 11:51
lcontrolcloud-3-11-31.log
This file has been truncated, but you can view the full file.
[test10_3_station] [27.10.2021 11:31:16.367] Connect 178.212.193.121:530
[test10_3_station] [27.10.2021 11:31:16.774] send [0, 1, 0, 0, 0, 6, 1, 3, 0, 1, 0, 10]
[test10_3_station] [27.10.2021 11:31:16.778] recv (178.212.193.121:530) [0, 1, 0, 0, 0, 23, 1, 3, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[test10_3_station] [Response Time] [27.10.2021 11:31:16.876] 178.212.193.121:530/1/Holdings/1..10: 4ms
[test10_3_station] [27.10.2021 11:31:16.876] Read succeed channels 178.212.193.121:530/1/Holdings/1..10
[test10_3_station] Read Channel 1: 0.0 (300.0ms)
[test10_3_station] Read Channel 2: 0.0 (300.0ms)
[test10_3_station] Read Channel 3: 0.0 (300.0ms)
[test10_3_station] Read Channel 4: 0.0 (300.0ms)
[test10_3_station] Read Channel 5: 0.0 (300.0ms)