Skip to content

Instantly share code, notes, and snippets.

View madebr's full-sized avatar
🇧🇪
alive

Anonymous Maarten madebr

🇧🇪
alive
View GitHub Profile
@madebr
madebr / !README.md
Created November 17, 2024 16:22 — forked from mmozeiko/!README.md
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@madebr
madebr / BlinkyTop.sim.cpp
Last active June 16, 2020 11:06
Running yosys' cxxrtl backend on blinky
#include "BlinkyTop.sim.h"
#if defined(CXXRTL_INCLUDE_CAPI_IMPL) || \
defined(CXXRTL_INCLUDE_VCD_CAPI_IMPL)
#include <backends/cxxrtl/cxxrtl_capi.cc>
#endif
#if defined(CXXRTL_INCLUDE_VCD_CAPI_IMPL)
#include <backends/cxxrtl/cxxrtl_vcd_capi.cc>
#endif
@madebr
madebr / CMakeLists.txt
Last active October 24, 2019 17:15
SWIG issue 1001
cmake_minimum_required(VERSION 3.14)
project(swig_test C)
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(SWIG REQUIRED)
include_directories(${PYTHON_INCLUDE_DIR})
@madebr
madebr / README.txt
Last active October 13, 2019 21:03
Python script to create c/h file from file to embed files
usage: c.py [-h] [--output OUTPUT] [--header HEADER] [--name [NAME]] [input]
Create c/h file from a resource to embed inside a program.
positional arguments:
input Input file to embed (default is stdin
optional arguments:
-h, --help show this help message and exit
--output OUTPUT, -o OUTPUT
@madebr
madebr / CMakeLists.txt
Last active August 10, 2018 20:00
glad cmake
cmake_minimum_required(VERSION 3.8)
project(project)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
include(GladLoaderGenerator)
set(egl_VERSIONS 1.0 1.1 1.2 1.3 1.4 1.5)
set(gl_VERSIONS 1.0 1.1 1.2 1.3 1.4 1.5 2.0 2.1 3.0 3.1 3.2 3.3 4.0 4.1 4.2 4.3 4.4 4.5 4.6)
@madebr
madebr / main.py
Created August 6, 2018 22:21
OpenRW fonts kerning tool
#!/usr/bin/env python3
import sys
from pathlib import Path
from collections import namedtuple
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
curdir = Path(__file__).resolve().parent
# /c/users/maarten/.conan/data/ffmpeg/4.0/bincrafters/stable/build/12489cf8e1654545422aac295a9de9edbd71f836/sources/configure --prefix=/c/users/maarten/.conan/data/ffmpeg/4.0/bincrafters/stable/package/12489cf8e1654545422aac295a9de9edbd71f836 --disable-doc --disable-programs --disable-shared --enable-static --pkg-config-flags=--static --toolchain=msvc --enable-postproc --enable-pic --disable-zlib --disable-bzlib --disable-lzma --enable-iconv --disable-libfreetype --disable-libopenjpeg --disable-libopenh264 --disable-libvorbis --disable-libopus --disable-libzmq --disable-sdl2 --disable-libx264 --disable-libx265 --disable-libvpx --disable-libmp3lame --disable-libfdk-aac --enable-gpl --disable-libmfx --disable-cuda --disable-cuvid --extra-cflags=-MD
ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
ALLUSERSPROFILE='C:\ProgramData'
ALL_COMPONENTS='
aac_adtstoasc_bsf
chomp_bsf
dump_extradata_bsf
dca_core_bsf
eac3_core_bsf
@madebr
madebr / CMakeLists.txt
Last active August 19, 2023 20:10
Simple CTest coverage project + script
cmake_minimum_required(VERSION 3.9)
project(cmake_coverage)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.c" "int main() {return 0;}")
add_executable(main
main.c
)
target_compile_options(main
@madebr
madebr / valgrind_output
Last active September 13, 2017 17:38
OpenRW - Valgrind output - 2017-09-13
==26514== Memcheck, a memory error detector
==26514== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==26514== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==26514== Command: rwgame/rwgame
==26514== Parent PID: 20869
==26514==
==26514== Syscall param writev(vector[...]) points to uninitialised byte(s)
==26514== at 0x7780680: __writev_nocancel (in /usr/lib64/libc-2.25.so)
==26514== by 0x93DBF86: ??? (in /usr/lib64/libxcb.so.1.1.0)
==26514== by 0x93DC384: ??? (in /usr/lib64/libxcb.so.1.1.0)
@madebr
madebr / Chrome Console Developer Output
Last active June 23, 2017 21:46
Lektor Admin Errors/Warnings
lowPriorityWarning.js?4545:40 Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs
printWarning @ lowPriorityWarning.js?4545:40
lowPriorityWarning @ lowPriorityWarning.js?4545:59
get @ React.js?d73f:100
(anonymous) @ InternalPropTypes.js?58a1:9
(anonymous) @ vendor.js:1261
__webpack_require__ @ vendor.js:74
(anonymous) @ PropTypes.js?3c34:12
(anonymous) @ PropTypes.js?3c34:102