Skip to content

Instantly share code, notes, and snippets.

@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active September 6, 2024 12:55 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@byronfriesen
byronfriesen / aws-linux-2-wordpress.sh
Last active November 2, 2023 19:14
Amazon Linux 2 LTS - Wordpress / PHP-FPM / NGINX / MariaDB / WP-CLI Auto Install
#!/bin/bash
##############################################################
# Set Your System and Wordpress Config Preferences
##############################################################
export SYSTEM_USER=username # User PHP-FPM runs under
# Database
export WP_DB_NAME=wordpress
@busterc
busterc / config
Last active October 27, 2024 22:41
[Fix Slow BitBucket] remove IPv6 from ssh/git for bitbucket.org #git #bitbucket #ssh
# https://bitbucket.org/site/master/issues/8809/cloning-and-pushing-excruciatingly-slow#comment-34263833
Host bitbucket.org
AddressFamily inet
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active November 14, 2024 18:54
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@twaddington
twaddington / charles-proxy-android.md
Last active November 10, 2024 10:19
How to set up Charles Proxy for the Android Emulator.

Charles Proxy Android

Note: Consider using mitmproxy instead of Charles. There is better, more recent, documentation for using mitmproxy on Android.

Steps

1. Add the Network Security Configuration to your app

@shagamemnon
shagamemnon / cloudflare-workers-base64.js
Created October 2, 2020 07:23
Decode Base64 encoded text in Cloudflare Workers
/* Demo: https://cloudflareworkers.com/#6168c0dbeb076f1e3ac7eb102082361f:https://www.google.com/ */
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
function fromBinary(msg) {
const ui = new Uint8Array(msg.length)
for (let i = 0; i < msg.length; ++i) {
ui[i] = msg.charCodeAt(i)