Skip to content

Instantly share code, notes, and snippets.

View jamsinclair's full-sized avatar
👣
They say good code starts from the feet

Jamie jamsinclair

👣
They say good code starts from the feet
View GitHub Profile
Readme: In the following pseudo code, [] indicates a subroutine.
Sometimes I choose to write the subroutine inline under the [] in order to maintain context.
One important fact about the way rollbacks are handled here is that we are storing state for every frame.
In any real implementation you only need to store one game state at a time. Storing a game
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones.
==Constants==
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing.
@Enichan
Enichan / browser_gamepad_id.txt
Created October 19, 2018 04:48
Gamepad id output for various controllers/gamepads across browsers, with regexes for how to get name, vendor id, and product id
This is output from the gamepad API's id property tested across a variety of browsers, along with regular expressions to
find the name, vendor id, and product id.
Chrome: Logitech Dual Action (STANDARD GAMEPAD Vendor: 046d Product: c216)
Xbox 360 Controller (XInput STANDARD GAMEPAD)
Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 05c4)
Sony PLAYSTATION(R)3 Controller (STANDARD GAMEPAD Vendor: 054c Product: 0268)
Pro Controller (Vendor: 057e Product: 2009)
8Bitdo SF30 Pro (Vendor: 2dc8 Product: 6000)
Firefox: 046d-c216-Logitech Dual Action
@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Last active April 20, 2025 05:41
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do