Skip to content

Instantly share code, notes, and snippets.

@aras-p
aras-p / preprocessor_fun.h
Last active June 21, 2024 12:20
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@pwign
pwign / ImageMagick Minecraft Skin
Created December 10, 2019 15:42
For converting 64x32 Minecraft skin to 64x64 format using ImageMagick
convert input.png -background transparent -extent 64x64 \
\( input.png -crop 4x4+4+16 -flop \) -geometry +20+48 -composite \
\( input.png -crop 4x4+8+16 -flop \) -geometry +24+48 -composite \
\( input.png -crop 4x12+8+20 -flop \) -geometry +16+52 -composite \
\( input.png -crop 4x12+4+20 -flop \) -geometry +20+52 -composite \
\( input.png -crop 4x12+0+20 -flop \) -geometry +24+52 -composite \
\( input.png -crop 4x12+12+20 -flop \) -geometry +28+52 -composite \
\( input.png -crop 4x4+44+16 -flop \) -geometry +36+48 -composite \
\( input.png -crop 4x4+48+16 -flop \) -geometry +40+48 -composite \
\( input.png -crop 4x12+48+20 -flop \) -geometry +32+52 -composite \
@LambdAurora
LambdAurora / optifine_alternatives_fabric.md
Last active June 30, 2024 17:13
Recommended OptiFine alternatives on Fabric

The list is moving out!

If you share this list, please use this link instead: https://lambdaurora.dev/optifine_alternatives

It may still be only a redirection link, but it will have a better web display of the list soon. And the list being on GitHub/GitHub pages improves load times.

The gist version of this list will stop being updated.

Why?

@MeguminSama
MeguminSama / Discord Experiments.js
Last active June 7, 2024 14:14
Discord Experiments.js
let cache; webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=r.c]);
var UserStore = Object.values(cache).find(m => m?.exports?.default?.getUser).exports.default;
var actions = Object.values(UserStore._dispatcher._actionHandlers._dependencyGraph.nodes);
var user = UserStore.getCurrentUser();
actions.find(n => n.name === "ExperimentStore").actionHandler.CONNECTION_OPEN({
type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
});
actions.find(n => n.name === "DeveloperExperimentStore").actionHandler.CONNECTION_OPEN();
webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";

Guide for cross compiling Windows GD Mods on Linux

Requirements

  • clang & llvm (make sure you have clang-cl)
  • cmake (duh)
  • git

1. Setting up xwin

Install xwin, you can also just use one of the unknown-linux tarballs from the releases

@advaith1
advaith1 / nitro.md
Created May 4, 2023 01:06
Discord Nitro Subscription Links
@angeld23
angeld23 / vanished_tweet_recovery.user.js
Last active June 23, 2024 17:01
Vanished Tweet Recovery: Detects whenever a tweet mysteriously vanishes from your timeline for no reason and allows you to re-open it
// ==UserScript==
// @name Vanished Tweet Recovery
// @namespace https://d23.dev/
// @version 1.1
// @description Detects whenever a tweet mysteriously vanishes from your timeline for no reason and allows you to re-open it
// @author angeld23
// @match *://*.twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant none
// ==/UserScript==
#include <stdio.h>
#define dont int
#define care main(
#define CURSE void
#define OF ) {
#define RA 0;
#define 𓀷 int
#define 𓃰 if
#define 𓂔 {
#define 𓂕 }
@OrionReed
OrionReed / dom3d.js
Last active July 7, 2024 02:00
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯