Skip to content

Instantly share code, notes, and snippets.

@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 16, 2025 18:47
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@endolith
endolith / sinc_interp.m
Created October 19, 2011 01:05
Perfect sinc interpolation in Matlab and Python
% From http://phaseportrait.blogspot.com/2008/06/sinc-interpolation-in-matlab.html
% Ideally "resamples" x vector from s to u by sinc interpolation
function y = sinc_interp(x,s,u)
% Interpolates x sampled sampled at "s" instants
% Output y is sampled at "u" instants ("u" for "upsampled")
% (EXPECTS x, s, and u to be ROW VECTORS!!)
% Find the period of the undersampled signal
T = s(2)-s(1);
@jameswawright
jameswawright / AwesomeCourses.md
Created January 16, 2025 18:44 — forked from teocci/AwesomeCourses.md
List of awesome university courses for learning Computer Science!

Awesome Courses Awesome

Introduction

There is a lot of hidden treasure lying within university pages scattered across the internet. This list is an attempt to bring to light those awesome courses which make their high-quality material i.e. assignments, lectures, notes, readings & examinations available online for free.

Table of Contents

@ukoloff
ukoloff / admin.js
Last active January 16, 2025 18:44
WMI samples using JScript
// Check Admin rights
var out = GetObject("winmgmts://./root/default:StdRegProv") .EnumKey(1 << 31 | 3, "S-1-5-20")
WScript.Echo("Admin =", !out)
@MarcAlx
MarcAlx / Main.cs
Created January 15, 2019 17:03
Unity Scene to Equirectangular png (spherical image)
/*
* This script produces a .png image from an Unity scene.
*
* Result image looks like this : https://fr.wikipedia.org/wiki/Fichier:Paris_s%27éveille_equirectangular_panorama.jpg
*
* inspired from : https://docs.unity3d.com/ScriptReference/RenderTexture.ConvertToEquirect.html
* and https://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html
*
* To use it add this script to your scene then run
*/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulirish
paulirish / what-forces-layout.md
Last active January 16, 2025 18:37
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
am force-stop com.android.settings
settings put global hidden_api_blacklist_exemptions "LClass1;->method1(
15
--runtime-args
--setuid=1000
--setgid=1000
--runtime-flags=2049
--mount-external-full
--target-sdk-version=29
--setgroups=3003
@K-Mistele
K-Mistele / Dockerfile
Last active January 16, 2025 18:36
Dockerfile for pgvector (postgres 16) + vectorscale by Timescale DB. Only what you need, no other timescale stuff.
FROM pgvector/pgvector:pg16
# install prerequisites
## rust
RUN apt-get update
RUN apt-get install -y build-essential curl git jq make gcc pkg-config clang postgresql-server-dev-16 libssl-dev
RUN apt-get update
# Get Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
@GavinRay97
GavinRay97 / Makefile
Last active January 16, 2025 18:35
Dump C/C++ vtable & record layout information (clang + msvc + gcc)
# Requirements:
# clang - The classes/structs you want to dump must be used in code at least once, not just defined.
# MSVC - The classes/structs you want to dump must have "MEOW" in the name for "reportSingleClass" to work.
# Usage:
# $ make dump_vtables file=test.cpp
dump_vtables:
clang -cc1 -fdump-record-layouts -emit-llvm $(file) > clang-vtable-layout-$(file).txt
clang -cc1 -fdump-vtable-layouts -emit-llvm $(file) > clang-record-layout-$(file).txt
g++ -fdump-lang-class=$(file).txt $(file)
cl.exe $(file) /d1reportSingleClassLayoutMEOW > msvc-single-class-vtable-layout-$(file).txt