Skip to content

Instantly share code, notes, and snippets.

View OverHash's full-sized avatar

OverHash OverHash

View GitHub Profile
@OverHash
OverHash / main.rs
Created July 10, 2022 23:22
Minecraft OAuth Authentication Rust Example
use std::{
collections::HashMap,
fs,
io::{self, Write},
};
use reqwest::Client;
use serde::{Deserialize, Serialize};
use serde_json::json;
@OverHash
OverHash / main.lua
Created July 21, 2020 19:08
Auto generate assets.d.ts file
-- instructions:
-- put the assets.lua into a ModuleScript inside ServerScriptService, then run this script inside the command bar
-- it will generate an output file in ServerScriptService, which you can then paste into assets.d.ts
local assets = require(game.ServerScriptService.assets)
local gen = [[declare namespace assetIds {
const ]]
function generateSection(sec)
local res = ''
@OverHash
OverHash / task1.ts
Created June 9, 2020 09:38
an error in roblox-ts refactor
const data = [3, 225, 1, 225, 6, 6, 1100, 1, 238, 225, 104, 0, 1101, 32, 43, 225, 101, 68, 192, 224, 1001, 224, -160, 224, 4, 224, 102, 8, 223, 223, 1001, 224, 2, 224, 1, 223, 224, 223, 1001, 118, 77, 224, 1001, 224, -87, 224, 4, 224, 102, 8, 223, 223, 1001, 224, 6, 224, 1, 223, 224, 223, 1102, 5, 19, 225, 1102, 74, 50, 224, 101, -3700, 224, 224, 4, 224, 1002, 223, 8, 223, 1001, 224, 1, 224, 1, 223, 224, 223, 1102, 89, 18, 225, 1002, 14, 72, 224, 1001, 224, -3096, 224, 4, 224, 102, 8, 223, 223, 101, 5, 224, 224, 1, 223, 224, 223, 1101, 34, 53, 225, 1102, 54, 10, 225, 1, 113, 61, 224, 101, -39, 224, 224, 4, 224, 102, 8, 223, 223, 101, 2, 224, 224, 1, 223, 224, 223, 1101, 31, 61, 224, 101, -92, 224, 224, 4, 224, 102, 8, 223, 223, 1001, 224, 4, 224, 1, 223, 224, 223, 1102, 75, 18, 225, 102, 48, 87, 224, 101, -4272, 224, 224, 4, 224, 102, 8, 223, 223, 1001, 224, 7, 224, 1, 224, 223, 223, 1101, 23, 92, 225, 2, 165, 218, 224, 101, -3675, 224, 224, 4, 224, 1002, 223, 8, 223, 101, 1, 224, 224, 1, 223, 224, 223, 1102,
@OverHash
OverHash / HitboxTest.lua
Created January 1, 2020 02:51
A test to see what method is the fastest
-- OverHash method: https://devforum.roblox.com/t/detecting-on-which-map-the-character-is/233463/13?u=overhash
-- Aznarog method: https://devforum.roblox.com/t/what-is-the-quickest-and-most-efficient-way-to-check-if-a-player-is-within-a-region/367554/5?u=overhash
-- EDmaster24 method: https://devforum.roblox.com/t/what-is-the-quickest-and-most-efficient-way-to-check-if-a-player-is-within-a-region/367554/3?u=overhash
-- ForeverHD method: https://devforum.roblox.com/t/zonecontroller-retrieving-players-within-an-area-zone/397465
local Functions = { }
local hitbox, part = workspace.Model.MAIN, workspace.Model.example
Functions["OverHash method"] = function()
local LocalDifference = (hitbox.CFrame - hitbox.CFrame.p):inverse() * (part.Position - hitbox.Position)
name: Run CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
-- This makes sure we can load Lemur and other libraries that depend on init.lua
package.path = package.path .. ";?/init.lua"
-- If this fails, make sure you've cloned all Git submodules.
local lemur = require("modules.lemur")
local habitat = lemur.Habitat.new()
local function newFolder(name, parent, content)
local folder
@OverHash
OverHash / DataStore2test.ts
Created December 15, 2019 01:57
This can be used to test if your contribution will work. Please note that you will have to upload your changes as an npm package, and test them here.
import * as DataStore2 from "@rbxts/PACKAGETESTNAME";
import { Players } from "@rbxts/services";
DataStore2.Combine('main', 'test', 'test2')
DataStore2.ClearCache()
DataStore2.PatchGlobalSettings({
SavingMethod: 'OrderedBackups'
})
Players.PlayerAdded.Connect(async player => {
@OverHash
OverHash / DataStore2OnUpdateBug.lua
Created December 11, 2019 23:35
An error with DataStore2
local Players = game:GetService('Players')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local DataStore2 = require(ReplicatedStorage:WaitForChild('DataStore2'))
DataStore2.Combine('DATA', 'test')
Players.PlayerAdded:Connect(function(player)
local store = DataStore2('test', player)