Skip to content

Instantly share code, notes, and snippets.

View aberba's full-sized avatar

Lawrence Aberba aberba

View GitHub Profile
@fecub
fecub / Game.java
Last active August 27, 2020 13:44
GameDev - Jumping Algorithm
/*
Initialize the variables
--------------------------
private int jumpWidth = 0;
private boolean jumpStatus = false;
private int gravity = 2;
private int jumpPower = 5;
private boolean startJump = false;
*/
@mgsisk
mgsisk / html.regex
Last active January 13, 2022 21:49
[HTML Regex] Regular expression pattern for matching HTML tags.
<(?(?=!--)!--[\s\S]*--|(?(?=\?)\?[\s\S]*\?|(?(?=\/)\/[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*|[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*(?:\s[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*(?:=(?:"[^"]*"|'[^']*'|[^'"<\s]*))?)*)\s?\/?))>
< # Tags always begin with <.
(? # What if...
(?=!--) # We have a comment?
!--[\s\S]*-- # If so, anything goes between <!-- and -->.
| # OR
(? # What if...
(?=\?) # We have a scripting tag?
\?[\s\S]*\? # If so, anything goes between <? and ?>.