Skip to content

Instantly share code, notes, and snippets.

View ayunami2000's full-sized avatar
👌
No u

ayunami2000

👌
No u
View GitHub Profile
@aamiaa
aamiaa / RevertNewLayout.md
Last active April 29, 2024 21:25
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

20 million digits of pi in under a minute with Julia

I recently discovered a relatively obscure algorithm for calculating the digits of pi: https://en.wikipedia.org/wiki/Gauss–Legendre_algorithm. Well, at least obscure compared to Chudnovsky's. Wikipedia notes that it is "memory-intensive" but is it really? Let's compare to the MPFR pi function:

function gauss_legendre(prec)
    setprecision(BigFloat, prec, base=10)
    GC.enable(false)
@Thespikedballofdoom
Thespikedballofdoom / YouTube Config Editor.user.js
Created October 26, 2022 23:08
YouTube Config Editor [Deal with youtube's new stupid experiments]
// ==UserScript==
// @name YouTube Config Editor
// @namespace goodtube.github.io
// @version 0.3.5
// @description Edits yt.config_
// @author GoodTube/Thespikedballofdoom
// @match *://*.youtube.com/*
// @exclude *studio.youtube.com/*
// @run-at document-start
// @grant none
@evg-zhabotinsky
evg-zhabotinsky / pressure-vent.sh
Created December 23, 2021 16:59
Steam "Pressure Vessel"-based runtime disabler
#!/bin/bash
# Steam "Pressure Vessel" runtime eliminator.
#
# Valve ships various pre-packaged runtime environments for games to use.
# They are cool, in a way: Most games "just work" with them.
# However, such convenience comes at the cost of performance and sometimes reliability.
#
# Normally, I disable any and all such runtimes and install all the required dependencies myself.
# However, running Windows games using Proton enforces use of a runtime.
# That runtime is shipped in a "Pressure Vessel" container, which is more isolated.
@UCIS
UCIS / gist:845eda1755d38eddfc3f0f99268c27da
Created June 17, 2020 18:50
Opus/WebM player in JavaScript
function OpusWebmPacker() {
var channels = 2;
var sample_rate = 48000;
var position = 0;
var packets = [];
var buffer = new Uint8Array(4 + 1275);
var buffer_offset = 0;
function Concat() {
@jacopocolo
jacopocolo / guide.md
Last active January 13, 2024 23:30
Making a Bitsy game compatible with the Nintendo 3ds browser

The Nintendo 3ds browser is capable of running Bitsy games! And it's a delightful Bitsy machine.

To make games compatible, we just need to teach the 3ds browser to speak the language Bitsy is written in: modern Javascript!

To do that we need two things:

  1. The html page that contains your game
  2. A <script> </script> html element we'll add at the top of the page that translates modern Javascript to somewhat Javascript.

The whole script element is here. Just select the whole thing and copy.

@blixt
blixt / OculusQuestCloudGaming.md
Last active February 29, 2024 17:07
Playing SteamVR games on the Oculus Quest

Playing SteamVR games on the Oculus Quest, without owning a PC

Setting up your Virtual Machine

We'll be creating a new Virtual Machine on Microsoft's cloud platform, Azure. The VM will have a beefy GPU just like a home computer so it can be used for playing games.

  1. Go to [the Azure portal][azure] and sign up or log in.
  2. If you are on a Free account, first go to Subscriptions and upgrade it to a Pay-as-you-go plan. Don't worry, you will get to keep any free credits you have. Azure's interface is a bit slow so this will take a minute.

⚠️ Make sure to not include any support plan because they will charge you monthly!

@dumptruckman
dumptruckman / DebugLogHandler.java
Last active April 25, 2022 06:40
A simple option for enabling debug logging in your Bukkit plugin,
/**
* Copyright 2019 dumptruckman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
@smo0z
smo0z / ProtonLaunch.sh
Last active May 3, 2024 07:04
Proton Launch Script
#!/bin/sh
# Application path
APP_PATH="$(dirname "${BASH_SOURCE[0]}")"
cd "$APP_PATH"
# Executable file
APP_EXEC="$APP_PATH/.exe"
# Steam / IDs