Skip to content

Instantly share code, notes, and snippets.

View tiffany352's full-sized avatar

Tiffany Bennett tiffany352

View GitHub Profile
@tiffany352
tiffany352 / adventofascension.css
Last active May 28, 2020 21:52
Dark themes for gamepedia
.mw-body {
background-color: #111;
color: #eee;
font-size: 1.2rem;
}
h1,
h2,
h3 {
color: #ddd;
@tiffany352
tiffany352 / AutoCraft.ahk
Last active April 12, 2020 04:06
Automates some of the tedious mouse movements when doing bulk crafting, you'll probably have to tweak all the numbers for your configuration (ctrl+m will show you the coords you clicked on to make this easier). Note that items are placed 18 "pixels" apart in the GUI since there's a 2 pixel border, multiply that by your Gui Scale value (mine is 3…
SetKeyDelay, 0
SetMouseDelay, 0
^c::
Send {Shift down}
Click 872 599
Sleep 30
Click 1654, 607
Send {Shift up}
return
@tiffany352
tiffany352 / Vector2.lua
Created March 10, 2020 02:37
Metatable based OOP example
-- This is a ModuleScript containing a single class, which you can require,
-- call .new(), and then call methods on the resulting object.
local Vector2 = {}
-- Setting __index to a table will cause missing keys in a table to redirect to the __index table.
-- We use this to redirect methods to the `Vector2` table.
Vector.__index = Vector2
-- Any method with a . can be called on the class itself, such as `Vector2.new()`, `Vector2.fromDirectionMagnitude`.
function Vector2.new(x, y)
jq .Classes[] as $class | $class.Members[].Name as $name | $name | select(test("Id")) | "\($class.Name).\($name)"
"Instance.GetDebugId"
"ABTestService.InitializeForUserId"
"Animation.AnimationId"
"AssetService.GetAssetIdsForPackage"
"BackpackItem.TextureId"
"CharacterMesh.BaseTextureId"
"CharacterMesh.MeshId"
"CharacterMesh.OverlayTextureId"
@tiffany352
tiffany352 / ref_ptr.h
Created November 5, 2019 05:24
Implementation of something vaguely resembling Arc but in C++
#pragma once
#include <atomic>
#include <new>
#include <cstdio>
namespace ref_ptr {
template<typename T>
class ref_ptr;
template<typename T>
local floor = math.floor
local char = string.char
local function encodeBase64(str)
local out = {}
local nOut = 0
local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
local strLen = #str
-- 3 octets become 4 hextets
java.lang.StackOverflowError
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:603)
at java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:678)
at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:737)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateParallel(ReduceOps.java:919)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
java.lang.StackOverflowError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.util.concurrent.ForkJoinTask.getThrowableException(Unknown Source)
at java.util.concurrent.ForkJoinTask.reportException(Unknown Source)
at java.util.concurrent.ForkJoinTask.invoke(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateParallel(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
pub struct Counter {
counter_label: WidgetElement,
container: WidgetElement,
child1: WidgetElement,
fragments: Vec<WidgetElement>,
}
impl Component<WidgetElement> for Counter {
type Props = ();
use some_crate::{UiElement, ListBox};
#[derive(Clone)]
pub struct User {
name: String,
id: u64,
}
pub struct UserList {
container: UiElement,