class wfJWT { private $claims; const JWT_TTL = 600; const ISSUER = 600; public static function extractTokenContents($token) { if (!is_string($token)) { throw new InvalidArgumentException('Token is not a string. ' . gettype($token) . ' given.'); } // Verify the token matches the JWT format. if (!preg_match('/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?$/', $token)) { throw new wfJWTException('Invalid token format.'); } list($header, $body, $signature) = explode('.', $token); // Test that the token is valid and not expired. $decodedHeader = base64_decode($header); if (!(is_string($decodedHeader) && $decodedHeader)) { throw new wfJWTException('Token header is invalid.'); } $header = json_decode($decodedHeader, true); if (!is_array($header)) { throw new wfJWTException('Token header is invalid.'); } $decodedBody = base64_decode($body); if (!(is_string($decodedBody) && $decodedBody)) { throw new wfJWTException('Token body is invalid.'); } $body = json_decode($decodedBody, true); if (!is_array($body)) { throw new wfJWTException('Token body is invalid.'); } return array( 'header' => $header, 'body' => $body, 'signature' => $signature, ); } /** * @param mixed $subject */ public function __construct($subject = null) { $this->claims = $this->getClaimDefaults(); $this->claims['sub'] = $subject; } /** * @return string */ public function encode() { $header = $this->encodeString($this->buildHeader()); $body = $this->encodeString($this->buildBody()); return sprintf('%s.%s.%s', $header, $body, $this->encodeString($this->sign(sprintf('%s.%s', $header, $body)))); } /** * @param string $token * @return array * @throws wfJWTException|InvalidArgumentException */ public function decode($token) { if (!is_string($token)) { throw new InvalidArgumentException('Token is not a string. ' . gettype($token) . ' given.'); } // Verify the token matches the JWT format. if (!preg_match('/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?$/', $token)) { throw new wfJWTException('Invalid token format.'); } list($header, $body, $signature) = explode('.', $token); // Verify signature matches the supplied payload. if (!$this->verifySignature($this->decodeString($signature), sprintf('%s.%s', $header, $body))) { throw new wfJWTException('Invalid signature.'); } // Test that the token is valid and not expired. $decodedHeader = base64_decode($header); if (!(is_string($decodedHeader) && $decodedHeader)) { throw new wfJWTException('Token header is invalid.'); } $header = json_decode($decodedHeader, true); if (!( is_array($header) && array_key_exists('alg', $header) && $header['alg'] === 'HS256' && $header['typ'] === 'JWT' )) { throw new wfJWTException('Token header is invalid.'); } $decodedBody = base64_decode($body); if (!(is_string($decodedBody) && $decodedBody)) { throw new wfJWTException('Token body is invalid.'); } $body = json_decode($decodedBody, true); if (!( is_array($body) && // Check the token not before now timestamp. array_key_exists('nbf', $body) && is_numeric($body['nbf']) && $body['nbf'] <= time() && // Check the token is not expired. array_key_exists('exp', $body) && is_numeric($body['exp']) && $body['exp'] >= time() && // Check the issuer and audience is ours. $body['iss'] === 'Wordfence ' . WORDFENCE_VERSION && $body['aud'] === 'Wordfence Central' )) { throw new wfJWTException('Token is invalid or expired.'); } return array( 'header' => $header, 'body' => $body, ); } /** * @param string $string * @return string */ public function sign($string) { $salt = wp_salt('auth'); return hash_hmac('sha256', $string, $salt, true); } /** * @param string $signature * @param string $message * @return bool */ public function verifySignature($signature, $message) { return hash_equals($this->sign($message), $signature); } /** * @return string */ public function __toString() { return $this->encode(); } /** * @param string $data * @return string */ public function encodeString($data) { return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); } /** * @param string $data * @return bool|string */ public function decodeString($data) { return base64_decode(strtr($data, '-_', '+/')); } /** * @return mixed|string */ protected function buildHeader() { return '{"alg":"HS256","typ":"JWT"}'; } /** * @return mixed|string */ protected function buildBody() { return json_encode($this->getClaims()); } /** * @return array */ protected function getClaimDefaults() { $now = time(); return array( 'iss' => 'Wordfence ' . WORDFENCE_VERSION, 'aud' => 'Wordfence Central', 'nbf' => $now, 'iat' => $now, 'exp' => $now + self::JWT_TTL, ); } /** * @param array $claims */ public function addClaims($claims) { if (!is_array($claims)) { throw new InvalidArgumentException(__METHOD__ . ' expects argument 1 to be array.'); } $this->setClaims(array_merge($this->getClaims(), $claims)); } /** * @return array */ public function getClaims() { return $this->claims; } /** * @param array $claims */ public function setClaims($claims) { $this->claims = $claims; } } class wfJWTException extends Exception { } The Philosophy of Bruce Lee • Spotter Up | Right Tactics
HomeSurvivalThe Philosophy of Bruce Lee • Spotter Up

The Philosophy of Bruce Lee • Spotter Up

Published on

spot_img

Statue by Cao Chong-en of Bruce Lee on the Avenue of Stars in Hong Kong. Photo by Johnson Lau / CC BY-SA 2.5.

Defeat is a state of mind; No one is ever defeated until defeat has been accepted as a reality.” Bruce Lee.

Bruce Lee was a legendary martial artist, actor, and philosopher whose influence transcends the world of martial arts. Born in San Francisco in 1940 and raised in Hong Kong, Lee developed a unique approach to martial arts that combined elements from various disciplines, leading to the creation of his own style, Jeet Kune Do. Beyond his physical prowess, Lee was a profound thinker who emphasized the importance of personal growth, adaptability, and self-expression. His philosophy, encapsulated in his famous dictum “Be like water,” continues to inspire millions around the world, making him an enduring icon of both martial arts and personal development.

Bruce Lee was not only a legendary martial artist but also a profound philosopher whose ideas have inspired millions. His philosophy is a blend of Eastern and Western thought, emphasizing personal growth, adaptability, and self-expression.

The Philosophy of Bruce Lee

1. Be Like Water

One of Bruce Lee’s most famous philosophical concepts is the idea of being like water. He believed that water’s formlessness and adaptability were qualities to emulate in life. Water can flow gently or crash powerfully, adapting to any container it is placed in. Lee applied this metaphor to martial arts and life, advocating for flexibility, resilience, and the ability to adapt to changing circumstances.

2. Self-Expression and Authenticity

Bruce Lee emphasized the importance of self-expression and being true to oneself. He believed that individuals should not blindly follow others but instead should seek their own path and express their unique identity. This idea is encapsulated in his famous quote: “Always be yourself, express yourself, have faith in yourself”.

3. Absorb What Is Useful

Lee’s philosophy was heavily influenced by his study of various martial arts and philosophies. He advocated for a pragmatic approach to learning, encouraging people to “absorb what is useful, discard what is not, and add what is uniquely your own.” This principle highlights the importance of continuous learning, critical thinking, and personal adaptation.

4. The Tao of Jeet Kune Do

Bruce Lee developed his own martial art, Jeet Kune Do, which translates to “The Way of the Intercepting Fist.” This martial art is a physical manifestation of his philosophical beliefs. Jeet Kune Do emphasizes simplicity, directness, and personal expression. It rejects rigid forms and techniques, instead focusing on adaptability and efficiency.

5. Mindfulness and Presence

Lee was a proponent of mindfulness and living in the present moment. He believed that true mastery in martial arts and life comes from being fully present and aware. This concept is closely related to the idea of “no mind” (mushin), a state of mental clarity and focus where one is free from distractions and fully engaged in the task at hand.

6. Overcoming Obstacles

Bruce Lee’s life was marked by numerous challenges, including racial discrimination, injuries, and professional setbacks. He viewed obstacles as opportunities for growth and believed in the power of perseverance. His mantra “Walk on!” reflects his belief in moving forward despite difficulties and using challenges as a means to strengthen oneself.

7. Interconnectedness and Universal Brotherhood

Lee believed in the interconnectedness of all people and the idea of universal brotherhood. He saw martial arts as a way to break down barriers and bring people together. This belief is reflected in his statement: “Under the sky, under the heavens, there is but one family”.

Wall paining of Bruce Lee in Tibilsi, Georgia. Photo by Giga Paitchadze / CC BY 2.0.

Implications for the Modern Warrior

Bruce Lee’s philosophy holds profound implications for the modern warrior, emphasizing adaptability, self-expression, and mindfulness. In today’s rapidly changing world, the ability to be like water—flexible and resilient—enables warriors to navigate diverse challenges with ease. Lee’s focus on self-expression encourages individuals to develop their unique skills and strategies, fostering innovation and personal growth. The principle of absorbing what is useful and discarding what is not promotes continuous learning and critical thinking, essential for staying ahead in any field. Moreover, Lee’s emphasis on mindfulness and presence helps warriors maintain mental clarity and focus, crucial for making swift, effective decisions under pressure. By integrating these timeless principles, modern warriors can enhance their effectiveness, resilience, and overall well-being.

Final Thoughts

Bruce Lee’s philosophy is a rich tapestry of ideas that blend Eastern and Western thought. His emphasis on adaptability, self-expression, continuous learning, and mindfulness has left a lasting impact on both martial arts and personal development. Lee’s teachings encourage individuals to live authentically, embrace change, and strive for personal excellence.

*The views and opinions expressed on this website are solely those of the original authors and contributors. These views and opinions do not necessarily represent those of Spotter Up Magazine, the administrative staff, and/or any/all contributors to this site.

Latest articles

Understanding Trenbolone Enanthate 200 Dosage

Trenbolone Enanthate is a powerful anabolic steroid that is widely used by athletes and...

Games, Bonuses, Mobile App, and Login Ways

Put out within the January 2006, Mister Cash is indeed one of the earliest...

The Understanding of Wagering Requirements in Casino Promotions: Why They Keep Players Coming Back

Casino bonuses appeal to millions of players worldwide, yet few understand how online casinos...

Mastering the basics A beginner's guide to understanding gambling principles

Mastering the basics A beginner's guide to understanding gambling principles Understanding Gambling Fundamentals Gambling is an...

More like this

Understanding Trenbolone Enanthate 200 Dosage

Trenbolone Enanthate is a powerful anabolic steroid that is widely used by athletes and...

Games, Bonuses, Mobile App, and Login Ways

Put out within the January 2006, Mister Cash is indeed one of the earliest...

The Understanding of Wagering Requirements in Casino Promotions: Why They Keep Players Coming Back

Casino bonuses appeal to millions of players worldwide, yet few understand how online casinos...