Feature | Before (String Array for 212 Permissions) | After (Bitmask for 212+ Permissions) |
---|---|---|
Permission Representation | An array of strings: ["USER_CREATE", "USER_READ", ...] |
A compact numerical value (or values): e.g., 9223372036854775807 |
Payload Content | Thousands of characters for permissions array content |
Around 20-80 characters (for 1-4 integers) for numerical mask(s) |
Approximate Encoded JWT Size | ~4.5 KB (4500 bytes) | ~0.33 KB - ~0.6 KB (330-600 bytes) |
HTTP Header Compatibility | Often exceeds common 4KB/8KB limits, causing errors | Easily stays well under 1KB, no issues |
Role | Binary | Octal | Symbolic |
---|---|---|---|
Owner | 111 | 7 | rwx |
Group | 101 | 5 | r-x |
Others | 101 | 5 | r-x |
Component | Estimated JSON Characters/Bytes | Notes |
---|---|---|
JWT Header (JSON String) | ~40 characters | Example: {"alg":"HS256","typ":"JWT"} |
Fixed Payload Claims (JSON String) | ~200 characters | iss , exp , iat , userid , email , plus the permissions array structure {"permissions":[]} |
Average Permission String Length | 10 characters | E.g., USER_CREATE |
Overhead per Permission in Array | ~3 characters | For quotes ("" ) and comma (, ) in JSON, i.e., "PERMISSION", |
Effective Length per Permission in JSON Payload | 13 characters |
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
<?php | |
abstract class Player { | |
public abstract function play(); | |
} | |
class Human extends Player { | |
public function play() { | |
echo "Human player makes a move.\n"; | |
} |
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
<?php | |
class Solution { | |
private $romans = [ | |
'M' => 1000, | |
'CM'=> 900, | |
'D'=>500, | |
'CD'=>400, | |
'C'=>100, | |
'XC'=>90, | |
'L'=>50, |
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
<?php | |
class Solution { | |
private $romans = [ | |
'I' => 1, | |
'V' => 5, | |
'X' => 10, | |
'L' => 50, | |
'C' => 100, | |
'D' => 500, | |
'M' => 1000 |
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 RPi.GPIO as GPIO | |
import time | |
servoPIN = 17 | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(servoPIN, GPIO.OUT) | |
p = GPIO.PWM(servoPIN, 50) # GPIO 17 for PWM with 50Hz | |
p.start(2.5) # Initialization | |
try: |
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
sdfsdsd |
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
# filter by request host header | |
varnishlog -q 'ReqHeader ~ "Host: example.com"' | |
# filter by request url | |
varnishlog -q 'ReqURL ~ "^/some/path/"' | |
# filter by client ip (behind reverse proxy) | |
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"' | |
# filter by request host header and show request url and referrer header |
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
# filter by request host header | |
varnishlog -q 'ReqHeader ~ "Host: example.com"' | |
# filter by request url | |
varnishlog -q 'ReqURL ~ "^/some/path/"' | |
# filter by client ip (behind reverse proxy) | |
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"' | |
# filter by request host header and show request url and referrer header |
NewerOlder