Skip to content

Instantly share code, notes, and snippets.

View eeryinkblot's full-sized avatar
🕶️
Stand proud. Fail loud. Git good.

Tony Kleiber eeryinkblot

🕶️
Stand proud. Fail loud. Git good.
  • FORTIS IT-Services GmbH
  • Magdeburg, Germany
View GitHub Profile
@eeryinkblot
eeryinkblot / !README.md
Created August 6, 2024 11:13 — 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).

@eeryinkblot
eeryinkblot / main.c
Created June 6, 2024 08:59
Windows Clipboard
#include <Windows.h>
#include <stdio.h>
int main() {
if (!OpenClipboard(NULL)) {
return 1;
}
HANDLE data = GetClipboardData(CF_TEXT);
if (data == NULL) {
@eeryinkblot
eeryinkblot / gist:234f3fcf1ffcbd720114ac1172e285c4
Created February 13, 2024 21:14
HumbleBundle Show Owned Books
books = ["Java Cookbook, 4th Edition"]; document.querySelectorAll('.tier-item-view').forEach(e => { span = e.getElementsByTagName('span')[0]; if (books.includes(span.innerText)) span.innerText = "✅ ".concat(span.innerText); });
@eeryinkblot
eeryinkblot / decompile.bat
Created January 8, 2024 14:02 — forked from mslinn/decompile.bat
Decompile JVM class files using IntelliJ IDEA's embedded FernFlower decompiler
java -cp "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true . src
@eeryinkblot
eeryinkblot / jq-cheetsheet.md
Created July 19, 2022 11:25 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@eeryinkblot
eeryinkblot / getRandomFirstName.sh
Created May 22, 2022 16:15
getRandomFirstName
#!/bin/sh
# Method with variables
length=`cat /usr/share/dict/propernames \
| wc -w \
| tr -d ' '`
position=`jot -r 1 1 $length`
cat /usr/share/dict/propernames | head -$position | tail -1
cabal list --installed
ghc-pkg list
# https://stackoverflow.com/questions/36953396/how-to-list-all-the-installed-packages-and-their-version-with-cabal
brewurl() {
brew info $1 | grep '^http.*';
}
# Example: brewurl vim
# Output: https://www.vim.org/
# In this example i will get line three
head -3 example.txt | tail +3
# Alternative with sed
sed -n '3p' example.txt
# Alternative with awk
awk 'NR==3' example.txt
# For more information please look here
kotlinc filename.kt -include-runtime -d filename.jar && java -jar filename.jar