Skip to content

Instantly share code, notes, and snippets.

View Hexcede's full-sized avatar

Hexcede

View GitHub Profile
@Hexcede
Hexcede / README.md
Last active August 20, 2023 17:58
Roblox Studio 64 bit Wine Workaround

I've attached a script which will automatically walk you through the entire workaround process.

ChromeOS users should run these commands inside of your Linux Terminal (not crosh).

In your Linux terminal

  1. Run cd ~/Downloads to navigate to your Downloads folder.
  2. Download the script. (E.g. by running wget https://gist.githubusercontent.com/Hexcede/7dfff16fbda540aa58b4381bd0c81c73/raw/setup_studio.sh)
  3. Run it via bash setup_studio.sh.
@Hexcede
Hexcede / README.md
Last active August 12, 2022 06:09
Building wine-tkg in Docker for Ubuntu
  1. Clone https://github.com/Frogging-Family/wine-tkg-git into an empty folder. Set up the configuration how you wish (make sure to use debuntu as well).
  2. Drop the build.sh script adjacent to the top wine-tkg-git folder and run it.
  3. (Optionally) delete the docker container with docker container rm wine-build once you're done (if you don't care about ccache or inputting your timezone again).
  4. Profit.
@Hexcede
Hexcede / readablenumber.lua
Last active June 21, 2022 02:53
Luau - Readable number (using string operations)
local function readableNumber(number: number, decimals: number)
-- If the number is whole, just round and convert to a string that way
if math.abs(number)%1 < 1e-9 then
return tostring(math.round(number))
end
-- Format as a float to the number of decimals (e.g. %.2f = 2 decimals)
local formatted = string.format(string.format("%%.%df", math.round(decimals)), number)
-- Find the decimal point
local point = string.find(formatted, "%.")
-- Find as many zeros on the end as possible (the $ anchor matches the end of the string)
@Hexcede
Hexcede / readablenumber.lua
Created June 21, 2022 02:02
Luau - Janky readable number rounding implementation
local function readableNumber(number: number, decimalCount: number?): string
local threshold = 1e-9
local remainder = math.abs(number)%1
if math.abs(1 - remainder) < threshold then
return tostring(math.round(number))
end
if not decimalCount then
decimalCount = 2
end