Skip to content

Instantly share code, notes, and snippets.

View namandixit's full-sized avatar
➡️
Guided by PointeSEGMENTATION FAULT

Naman Dixit namandixit

➡️
Guided by PointeSEGMENTATION FAULT
View GitHub Profile
@Ionizing
Ionizing / incbin.c
Last active November 27, 2024 05:21 — forked from mmozeiko/incbin.c
Include binary file with gcc/clang
#define STR2(x) #x
#define STR(x) STR2(x)
#ifdef __APPLE__
#define USTR(x) "_" STR(x)
#else
#define USTR(x) STR(x)
#endif
#ifdef _WIN32
@mmozeiko
mmozeiko / !README.md
Last active April 29, 2025 22:17
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).

@hjhsalo
hjhsalo / locate-pointer-starter.sh
Last active December 3, 2024 12:14 — forked from sneetsher/locate-pointer.c
Locate mouse pointer (Highlight is removed after a certain amount of loop cycles. Optional bash startup script to prevent duplicate instances.)
#!/bin/bash
# A simple script to check if a process is running and if it is will
# kill and restart the process
# Modified from example provided at:
# https://www.m00nie.com/2011/12/script-to-check-if-a-process-is-running-and-if-not-start-it/
################################################
# The name of the program to check
PROGRAM=locate-pointer
################################################
@rsvp
rsvp / noise.sh
Last active March 15, 2025 12:01
noise : relaxing ambient Brown noise generator (cf. white noise) | Linux bash script using sox | CogSci notes
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2019-01-02
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)