Skip to content

Instantly share code, notes, and snippets.

View Quenty's full-sized avatar
🎉
Follow me on Twitter @Quenty

James Onnen Quenty

🎉
Follow me on Twitter @Quenty
View GitHub Profile
local ToolTip = require("ToolTip")
local RoundToolTip = setmetatable({}, ToolTip)
RoundToolTip.__index = RoundToolTip
function RoundToolTip.new()
local self = setmetatable(ToolTip.new(), RoundToolTip)
return self
end
@Quenty
Quenty / analytics.py
Created March 11, 2019 17:54
Analytics script to count lines of Lua code
"""
Utility script to count lines of Lua code
Author: Quenty
"""
import glob, os
def file_len(fname):
"""
Counts lines of a file given the name
@Quenty
Quenty / SublimeLinter.sublime-settings
Created July 8, 2019 00:11
SublimeLinter.sublime-settings
// SublimeLinter Settings - User
{
"lint_mode": "background",
"linters":
{
"luacheck":
{
"@disable": false,
"args":
[
--[[
SoftShutdown 1.2
URL: https://github.com/MerelyRBLX/ROBLOX-Lua/blob/master/SoftShutdown.lua
Author: Merely
This system lets you shut down servers without losing a bunch of players.
When game.OnClose is called, the script teleports everyone in the server
into a reserved server.
When the reserved servers start up, they wait a few seconds, and then
@Quenty
Quenty / BadConnectionCode.lua
Created August 12, 2019 21:25
BadConnectionCode.lua
local MyClass = {}
MyClass.__index = MyClass
function MyClass.new()
local self = setmetatable({}, MyClass)
self._connection = nil
self._tooltip = nil
return self
@Quenty
Quenty / IgnoreCameraClient.lua
Created August 29, 2019 21:19
IgnoreCameraClient.lua
--- Utilizes a hack to force the popper camera to blacklist the parts in question
-- @classmod IgnoreCameraClient
-- @author Quenty
local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))
local RunService = game:GetService("RunService")
local HttpService = game:GetService("HttpService")
local BaseObject = require("BaseObject")
local function cross(vector0, vector1)
local ux, uy = vector0[1], vector0[2]
local vx, vy = vector1[1], vector1[2]
return ux*vy - uy*vx
end
local function area(points)
local area = cross(points[#points], points[1])
for i=1, #points-1 do
---
-- @module WaveCollapseUtils
-- @author Quenty
local WaveCollapseUtils = {}
local EDGE_DATA = {
{
2, -- Edge index (forward)
1, -- Neighbor's edgeindex (backward)
---
-- @classmod CameraChallenge
-- @author Quenty
local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))
-- Challenge:
-- 1. Make `camera' always point to the the current or last known camera.
-- a. Problem: CurrentCamera can be nil.
-- b. Guarantee that `camera' is never nil.
local function readonly(_table)
return setmetatable(_table, {
__index = function(self, index)
error(("Bad index %q"):format(tostring(index)), 2)
end;
__newindex = function(self, index, value)
error(("Bad index %q"):format(tostring(index)), 2)
end;
})
end