This file contains 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, json, binascii | |
# Decode the token and extract the header if correct format | |
jwt = input("Please enter your JWT Token: ") | |
try: | |
jwtVals = jwt.split(".") | |
payload = (base64.b64decode(jwtVals[1]+'=')).decode("utf-8") | |
header = (base64.b64decode(jwtVals[0]+'=')).decode("utf-8") | |
except (IndexError, binascii.Error) as err: | |
print("\n\n*** Incorrect token format, please enter a valid JWT Token ***\n\n") |
This file contains 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, json, binascii | |
# Decode the token and extract the header if correct format | |
jwt = input("Please enter your JWT Token: ") | |
try: | |
jwtVals = jwt.split(".") | |
payload = jwtVals[1] | |
header = (base64.b64decode(jwtVals[0]+'=')).decode("utf-8") | |
except (IndexError, binascii.Error) as err: | |
print("\n\n*** Incorrect token format, please enter a valid JWT Token ***\n\n") |
This file contains 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
//req = type of HTTP request (POST, GET, DELETE etc.) | |
//theUrl = path to make the request to | |
//JWT = JWT Token to be injected into token cookie and authorization header | |
function httpReq(req, theUrl, JWT){ | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.open(req, theUrl, false ); | |
xmlHttp.setRequestHeader("Authorization", "Bearer "+JWT); | |
xmlHttp.withCredentials = true; | |
xmlHttp.send( null ); | |
return xmlHttp.responseText; |
This file contains 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
public static Node subList(Node start, int idx1, int idx2) { | |
int length = getLength(start, 0); //how many items | |
if(!isValidIdx(length, idx1, idx2) || start == null) { | |
return null; | |
} | |
Node temp = get(new Node(start.data, start.next), idx1); //get item at index | |
return subList(temp, (idx2-idx1+1)); | |
} | |
This file contains 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
/* | |
* CLUB PENGUIN DANCEFLOOR 2.0 | |
* Use the arrow keys to move your penguin around the floor | |
* Continuously Press Space Bar to activate the Dance Floor | |
* Click on a cell to move your penguin to that cell | |
* Enter the correct password to start a penguin party | |
*/ | |
This file contains 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
//https://www.youtube.com/watch?v=YKMB2HtJZEo | |
void setup() { | |
size(800, 800); | |
stroke(255); | |
strokeWeight(3); | |
drawDanceFloorPlease(); | |
} | |
void draw() { |