Skip to content

Instantly share code, notes, and snippets.

View malkia's full-sized avatar

Dimiter 'malkia' Stanev malkia

View GitHub Profile
@malkia
malkia / tictactoe.dart
Created November 21, 2020 21:45
Super Tic Tac Toe in Flutter
import 'package:flutter/material.dart';
// https://github.com/malkia/tictactoc
// https://malkia.github.io/tictactoe
// https://codepen.io/malkia76/pen/YzWojXy
void main() {
runApp(myApp());
}
dvc
oxen
xethub
dagshub
doithub
pachyderm
...?
@malkia
malkia / gist:768683a52baf41fba318535ca34877ba
Created January 22, 2024 01:46
restart batch file with admin rights
net sessions 1>nul 2>nul || (
rem Restart with admin rights the same script
PowerShell "Start-Process -FilePath '%0' -Verb RunAs -ArgumentList wait"
exit %ERRORLEVEL%
)
@malkia
malkia / hook.c
Created October 26, 2023 04:52 — forked from mmozeiko/hook.c
reads process stdout + stderr and prints it out as it becomes available
// compile this to hook.dll
// for example, with MSVC: cl.exe /LD /MT /O2 hook.c /Fehook.dll
#include <windows.h>
// get this from https://github.com/kubo/plthook
#include "plthook_win32.c"
static plthook_t* hook;
@malkia
malkia / etw_createfile.c
Created October 26, 2023 04:32 — forked from mmozeiko/etw_createfile.c
Monitor which files are accessed with ETW
// this code will work only when compiled as 64-bit code, and on Windows 10
// older Windows version might require different structure definitions
#define NOMINMAX
#define INITGUID
#include <windows.h>
#include <evntrace.h>
#include <evntcons.h>
#pragma comment (lib, "shell32.lib")
@malkia
malkia / malkia_diff.txt
Created May 8, 2023 20:28
patch to my windows build of envoy (plus some of contrib)
diff --git a/.bazelrc b/.bazelrc
index 637a9a65be..bb77b3fb71 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -430,3 +430,5 @@ build:windows --dynamic_mode=off
try-import %workspace%/clang.bazelrc
try-import %workspace%/user.bazelrc
try-import %workspace%/local_tsan.bazelrc
+
+try-import %workspace%/../../malkia/top.bazelrc
@echo off
set BAZEL_SH=c:\program files\git\usr\bin\bash.exe
set PATH=c:\program files\git\usr\bin;c:\program files\git\cmd;d:\sys\bazel;c:\python311;c:\python311\scripts;%PATH%
set MSYS2_ARG_CONV_EXCL=*
set MSYS2_PATH_TYPE=inherit
set TMPDIR=C:/Windows/TEMP
set TEMP=C:/Windows/TEMP
set TMP=C:/Windows/TEMP
bazel --output_base=f:\_eb build -k --enable_runfiles --config=windows -c opt --config=sizeopt --config=msvc-cl envoy
bazel --output_base=f:\_eb run --enable_runfiles --config=windows -c opt --config=sizeopt --config=msvc-cl envoy
@malkia
malkia / t1.bzl
Created January 1, 2023 21:41
force_compilation_mode bazel transition rule
force_compilation_mode = rule(
# implementation = lambda ctx:
# DefaultInfo( runfiles = ctx.runfiles(
# transitive_files = depset(
# transitive = [ depset( transitive = [x[DefaultInfo].files] ) for x in ctx.attr.data ]
# ))),
implementation = lambda ctx:
DefaultInfo( files = depset(
transitive = [ depset( transitive = [x[DefaultInfo].files] ) for x in ctx.attr.data ]
)),
@malkia
malkia / buiild.cue
Last active February 10, 2022 02:17
cue example of references using integer indexes, then transforming them into bits
import (
"list"
)
build: {
proj1: {
deps: [
"proj2",
]
}
// Try on DartPad.dev
import 'package:flutter/foundation.dart'
show debugDefaultTargetPlatformOverride;
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'dart:math';
import 'dart:async';
var random = Random(0);