This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import ecdsa | |
def generate_vapid_keypair(): | |
""" | |
Generate a new set of encoded key-pair for VAPID | |
""" | |
pk = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p) | |
vk = pk.get_verifying_key() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fish shell | |
# REUSE ENVIRONMENT VARIABLES FROM ~/.bash_profile | |
bash -c '. ~/.bash_profile; env' | while read e | |
set var (echo $e | sed -E "s/([a-zA-Z0-9_]+)=(.*)\$/\1/") | |
set value (echo $e | sed -E "s/([a-zA-Z0-9_]+)=(.*)\$/\2/") | |
# remove surrounding quotes if existing | |
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- $ sudo opm get jkeys089/lua-resty-hmac | |
local shell = require "resty.shell" | |
local cjson = require "cjson.safe" | |
local hmac = require "resty.hmac" | |
local secret = '<MY SUPER SECRET>' | |
local event = 'push' | |
local branch = 'refs/heads/master' |