Skip to content

Instantly share code, notes, and snippets.

View deminearchiver's full-sized avatar
🎯
Focusing

deminearchiver deminearchiver

🎯
Focusing
View GitHub Profile
@aamiaa
aamiaa / RevertNewLayout.md
Last active July 31, 2024 04:40
Revert New Discord Layout

The original snippet no longer works!

On 02/09/2024 at around 8pm UTC, Discord flipped an experiment (2023-09_mobile_redesign_override_toggles) which ignores the layout toggle that this script relied on.

If you want to continue using the old layout, you can either use a modded mobile client (such as Vendetta) to disable that experiment, or downgrade to an old version of the app.

Method 1 - Downgrading (Android)

Tip

Use this one if you want a fast, beginner-friendly solution and don't mind using a version from November 2023

  1. Download version 205.15 of Discord mobile app from ApkMirror
@cobaltgit
cobaltgit / README.md
Last active July 30, 2024 21:20
A Guide to Discord Bot Hosting

Cobalt's Guide to Discord Bot Hosting

Here is a guide to help you what Discord bot host to pick. This was originally a tag on the discord.py server, but was moved to this GitHub gist as it eventually rolled over the 2000 character limit.

VPS Hosting (best)

I recommend a cheap VPS server as the best way to host your bot online for 24/7. Here are some good picks, credit to the discord.py server for this

Scaleway - EU
Linode - EU/US/Asia

@AngDrew
AngDrew / flutter_preload_image.dart
Last active June 6, 2024 08:53
preload flutter image for splash screen. so there will be no blank screen blink
// @dart=2.12
// load_image.dart
import 'dart:async';
import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/services.dart';
Future<void> loadImage(ImageProvider provider) {
@ADeltaX
ADeltaX / main.cpp
Created June 18, 2021 11:46
DWM Thumbnail/VirtualDesktop USING Windows.UI.Composition
#include <Unknwn.h>
#include <Windows.h>
#include <wrl\implements.h>
#include <comutil.h>
#include <dcomp.h>
#include <dwmapi.h>
#include <dxgi1_3.h>
#include <d3d11_2.h>
#include <d2d1_2.h>
#include <d2d1_2helper.h>
@ADeltaX
ADeltaX / main.cpp
Created March 22, 2021 15:38
DWM Thumbnail/VirtualDesktop IDCompositionVisual example
#include <Unknwn.h>
#include <Windows.h>
#include <ntstatus.h>
#include <winternl.h>
#include <wrl\implements.h>
#include <comutil.h>
#include <dcomp.h>
#include <dwmapi.h>
#include <dxgi1_3.h>
#include <d3d11_2.h>
@sindresorhus
sindresorhus / esm-package.md
Last active July 31, 2024 03:14
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@rexim
rexim / main.cpp
Created October 7, 2020 12:19
PCRE2 C++ example with named capture groups
#define PCRE2_CODE_UNIT_WIDTH 8
#include <stdio.h>
#include <string.h>
#include <pcre2.h>
#define MY_PATTERN "\\[(?<hours>\\d+):(?<minutes>\\d+):(?<seconds>\\d+)(\\.(?<milliseconds>\\d+))?\\] \\<(?<nickname>\\w+)\\> (?<message>.*)"
#define MY_SUBJECT "[0:00:01] <Tsoding> forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls"
const char *line_comps[] = {
@bogdibota
bogdibota / installer.nsh
Last active September 25, 2023 04:25
electron-builder nsis install c++ redist 2017-2019
!include LogicLib.nsh
!macro customInit
Var /GLOBAL VCRedistDownload
${If} ${RunningX64}
;HKCR\Installer\Dependencies\VC,redist.x64,amd64,14.21,bundle\Dependents\{f4220b74-9edd-4ded-bc8b-0342c1e164d8}
;HKCR\Installer\Dependencies\VC,redist.x64,amd64,14.22,bundle\Dependents\{6361b579-2795-4886-b2a8-53d5239b6452}
;HKCR\Installer\Dependencies\VC,redist.x64,amd64,14.23,bundle\Dependents\{852adda4-4c78-4a38-b583-c0b360a329d6}
;HKCR\Installer\Dependencies\VC,redist.x64,amd64,14.24,bundle\Dependents\{282975d8-55fe-4991-bbbb-06a72581ce58}
@ADeltaX
ADeltaX / main.cpp
Last active July 17, 2024 16:55
Example of creating a window using a private api on a dll-injected immersive process
#include "pch.h"
#pragma comment(lib, "gdi32.lib")
enum ZBID
{
ZBID_DEFAULT = 0,
ZBID_DESKTOP = 1,
ZBID_UIACCESS = 2,
ZBID_IMMERSIVE_IHM = 3,
ZBID_IMMERSIVE_NOTIFICATION = 4,
@karol-majewski
karol-majewski / homogeneous-array.ts
Created September 22, 2019 22:13
Homogeneous arrays in TypeScript (+ check if a type is a union)
type Singleton = string;
type Union = string | number;
type DistributedKeyOf<T> =
T extends any
? keyof T
: never;
type DistributedValueOf<T> = T[DistributedKeyOf<T>];