Skip to content

Instantly share code, notes, and snippets.

View stravant's full-sized avatar

Mark Langen stravant

  • Roblox
  • Bay Area
View GitHub Profile
@stravant
stravant / parse.py
Last active December 12, 2015 12:19
Python Parser
import builtins
###############################################################################
#From SO: http://stackoverflow.com/questions/1988804/
class Memoize:
def __init__(self, f):
self.f = f
import random
graph = [
(0,0),
(20,0),
(20,20),
(0,20),
]
#add some random points
ZERO = 0
ONE = 1
EITHER = 2
nvars = 4
varnames = ['a', 'b', 'c', 'd']
func = lambda a,b,c,d: (a and b) or (c and d)
@stravant
stravant / grab_tracked.lua
Created November 17, 2014 21:27
Grab posts from the Roblox forums from your tracked threads
#!/usr/bin/lua
local tracked_url = "http://www.roblox.com/Forum/User/MyForums.aspx"
local base_url = "http://www.roblox.com/Forum/ShowPost.aspx?PostID="
local cookie = "(Paste your .ROBLOSECURITY cookie which you can find in your browser cookies, don't share this script with it still pasted in there obviously)"
function cmd(txt)
os.execute(txt)
end
@stravant
stravant / thread_fetch.lua
Created November 17, 2014 21:55
Tracked Thread saver for Roblox Forums
#!/usr/bin/lua
local tracked_url = "http://www.roblox.com/Forum/User/MyForums.aspx"
local base_url = "http://www.roblox.com/Forum/ShowPost.aspx?PostID="
-- Paste your .ROBLOSECURITY cookie below, you can find the cookie by viewing www.roblox.com's
-- cookies in your browser while you are logged in.
-- DO NOT SHARE THIS VALUE, it can be used to log into your current account session.
local cookie = ""
This file has been truncated, but you can view the full file.
[
{
"year": 2012,
"month": 4,
"day": 21,
"players": [
{"username": "White Wolf", "pp": 6604, "userId": 39828},
{"username": "Cookiezi", "pp": 6602, "userId": 124493},
{"username": "SiLviA", "pp": 6527, "userId": 409747},
{"username": "Rucker", "pp": 6450, "userId": 147515},
@stravant
stravant / Wist.lua
Last active February 28, 2017 22:47
--[[
Flow:
-
]]
local WistServer = {}
function WistServer.new(players)
@stravant
stravant / scramble.lua
Created October 30, 2019 00:48
Scramble the object placement in an osu map
--X: 0-512
--Y: 0-384
-- Type bits: (-)(-)(-)(-) (spinner)(NC)(slider)(circle)
-- Circle: x,y,time,type,hitSound,extras
-- Slider: x,y,time,type,hitSound,sliderType|curvePoints,repeat,pixelLength,edgeHitsounds,edgeAdditions,extras
-- type = Linear Perfect Bezier Catmul
--[[
Micro-optimized code for computing a local space and the global space
bounding box for a set of parts and attachments as fast as possible.
]]
local function computeTwoBoundingBoxes(basisCFrame1, allParts, allAttachments)
local basisX, basisY, basisZ = basisCFrame1.X, basisCFrame1.Y, basisCFrame1.Z
local inverseBasis1 = basisCFrame1:Inverse()
local xmin1, xmax1 = math.huge, -math.huge
local ymin1, ymax1 = math.huge, -math.huge
local zmin1, zmax1 = math.huge, -math.huge