brew install cloudflare/cloudflare/cloudflared
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
<?php | |
namespace App\Services; | |
use ReflectionClass; | |
use Illuminate\Support\Facades\File; | |
class ArrayToShapeConverter | |
{ | |
public function __construct(private string $basePath, private readonly string $namespace) |
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
wget -qO wo wops.cc && sudo bash wo | |
# Auto completion | |
source /etc/bash_completion.d/wo_auto.rc | |
echo -e "alias wo='sudo -E wo'" >> $HOME/.bashrc | |
source $HOME/.bashrc | |
# Install stack | |
wo stack install |
If you're on macOS and suddenly composer has started throwing this weird error and you're wondering where the problem is, well, here's the solution and how to debug.
Error when you run composer global update
or any other similar commands.
In Process.php line 441:
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
<?php | |
/** | |
* Retrieve the IP address of the visitor. | |
* | |
* @return string | |
*/ | |
function getIPAddress() | |
{ | |
foreach (['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'] as $key) { |
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
// Usage | |
class Kernel extends HttpKernel | |
{ | |
// ..... | |
// ..... | |
// ..... | |
protected $routeMiddleware = [ | |
// ..... |
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
<!-- | |
- Info: https://csswizardry.com/2020/05/the-fastest-google-fonts/ | |
- | |
- 1. Preemptively warm up the fonts’ origin. | |
- | |
- 2. Initiate a high-priority, asynchronous fetch for the CSS file. Works in | |
- most modern browsers. | |
- | |
- 3. Initiate a low-priority, asynchronous fetch that gets applied to the page | |
- only after it’s arrived. Works in all browsers with JavaScript enabled. |
Supported routers (Netgear R7800, R8900, and R9000)
- Make sure telnet is enabled in your router. You can visit this page and enable (login when prompted): http://www.routerlogin.com/debug.htm.
- Once you telnet into your router using your routers password, you should setup your SSH key.
- [Recommended] Add SSH key
id_rsa.pub
to/root/.ssh/authorized_keys
(You might have to create this dir and file manually if not it doesn't already exist).
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
// Perform regex replacements and inject CSS/JavaScript with Cloudflare Workers | |
// https://community.cloudflare.com/t/perform-regex-replacements-and-inject-css-javascript-with-cloudflare-workers/90279 | |
addEventListener('fetch', event => { | |
event.passThroughOnException() | |
event.respondWith(handleRequest(event.request)) | |
}) | |
/** | |
* Fetch and log a given request object | |
* @param {Request} request |