Skip to content

Instantly share code, notes, and snippets.

View WilliamVenner's full-sized avatar
🤠

William WilliamVenner

🤠
  • Sussex, England
  • 10:49 (UTC +01:00)
View GitHub Profile
fn fib<T>(n: T) -> T
where
T: core::cmp::PartialOrd + core::ops::Sub<Output = T> + core::ops::AddAssign + num::One + num::Zero + Clone
{
if n <= T::zero() { return T::one() };
if n == T::one() || n == T::one() + T::one() { return T::one() };
let mut a = T::zero();
let mut b = T::one();
@WilliamVenner
WilliamVenner / discord_server_emoji_dump.js
Created March 3, 2022 14:28
Dump emoji URLs from your server
console.log([...document.querySelectorAll('.emojiColumn-2P3Fj1 .emojiImage-1sHmM-')].map(elem => {
const url = elem.style.backgroundImage.replace(/.*(http.+?)"\)/, '$1').replace('.webp', '.png').replace(/size=\d+&/, '');
const ext = url.match(/\d+\.(\S+?)\?.+$/)[1];
return 'wget ' + url + ' -O ' + elem.parentNode.parentNode.querySelector('.emojiInput-B8MGXq').value + '.' + ext;
}).join('\n'));

New XEON DRM

Hey guys, I have finally finished my new DRM. Same name, same familiar activation process, improved looks, security, reliability, and certainly less tickets.

The new DRM is currently in BETA TESTING - this means that you may encounter problems with it. I have done my best to test every aspect of it, but nothing is bug free until you set it off into the wild.

I will be instructing customers who have problems with the current DRM to switch to the new one.

You will need to update GmodAdminSuite on the Workshop

["An error doesn't become a mistake until you refuse to correct it.","In the beginning was the Statement, and the Statement was with Lua, and the Statement was Lua.","Lua was the answer to my prayers.","Greater love has no one than Lua, that the compiler lay down his life for our code.","Do not think that I will debug with the Stack Trace; For had ye believed the Compiler Errors, ye would have believed Me, for he wrote of Lua; But if ye believe not his Stack Traces, how shall ye believe My code?","Even though my types remain weak, I fear no error, for Lua is with me.","Thinking will not overcome bugs, but action will.","Lua is what the heart needs all the time.","Lua is the chain that ties our health and bodies together.","Spam is only another flower to be picked in the path to find Lua.","Do not let your code be troubled. Trust in Lua; trust also in me.","Rip scripts, you must not. Let the Lua flow straight from your fingers.","Variables are changed by your example, not by your opinion.","The meaning of Lua
// https://www.win.tue.nl/~vanwijk/stm.pdf
use treemap::TreeMap;
mod treemap {
use serde::Serialize;
use super::AnalyzedAddon;
#[derive(Debug, Clone, Serialize)]
pub(super) struct MappedGMAFile {
#[serde(flatten)]
pub(super) inner: AnalyzedAddon,
// Copyright (C) Microsoft Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// These are the WebView2 experimental APIs published publicly as a part of the
// WebView2 prerelease package. Modifications to any published interface require
// a breaking change for the experimental APIs. Otherwise, do not modify
// published interfaces.
// midl is run from a tools directory with no special include paths setup.
var tests = {};
tests.InSine = function(x) {
return 1 - Math.cos((x * Math.PI) / 2);
}
tests.OutSine = function(x) {
return Math.sin((x * Math.PI) / 2);
}
{
"InQuint": [
0,
0,
0,
4.235164736271502e-22,
0,
6.776263578034403e-21,
1.3552527156068805e-20,
0,
{"InQuint":{"0":0.0,"1":1.0000000000000002e-8,"2":3.2000000000000008e-7,"3":0.0000024299999999999998,"4":0.000010240000000000002,"5":0.00003125000000000001,"6":0.00007775999999999999,"7":0.00016807000000000006,"8":0.00032768000000000006,"9":0.0005904899999999999,"10":0.0010000000000000003,"11":0.00161051,"12":0.0024883199999999998,"13":0.0037129300000000007,"14":0.005378240000000002,"15":0.007593749999999998,"16":0.010485760000000002,"17":0.014198570000000004,"18":0.018895679999999999,"19":0.02476099,"20":0.03200000000000001,"21":0.04084100999999999,"22":0.05153632,"23":0.06436343000000002,"24":0.07962623999999999,"25":0.09765625,"26":0.11881376000000002,"27":0.14348907000000006,"28":0.17210368000000007,"29":0.20511148999999993,"30":0.24299999999999995,"31":0.28629150999999999,"32":0.33554432000000009,"33":0.3913539300000001,"34":0.45435424000000015,"35":0.5252187499999999,"36":0.6046617599999999,"37":0.6934395699999999,"38":0.79235168,"39":0.9022419900000002,"40":1.0240000000000003,"41":1.1585620099999996,"4
file.Delete("easings.js.txt", "DATA")
local easingsJS = file.Open("easings.js.txt", "ab", "DATA")
easingsJS:Write("var tests = {};\n")
file.Delete("easings.lua.txt", "DATA")
local easings = util.JSONToTable(file.Read("easings.json", "DATA"))
local easingsLua = file.Open("easings.lua.txt", "ab", "DATA")
local function convertIndent(code)
code = code:gsub("^ ", "\t"):gsub("\n ", "\n\t")