Keybase proof
I hereby claim:
- I am matheusmk3 on github.
- I am matt_pratta (https://keybase.io/matt_pratta) on keybase.
- I have a public key ASDtG3s8ze8nRwrdpdrAOs2cwtplnNiwkhHoXNAEzSTCvAo
To claim this, I am signing this object:
/** | |
* fn.flatten_redirect_chain.php | |
* Follows a redirect chain path and either redirects to the final URL or returns it | |
* Author: Matheus Pratta <github.com/matheusmk3> | |
* License: 0BSD | |
* Version: 1.0.0 | |
* | |
* @param string $destination The URL that is part of a redirect chain and shall be resolved | |
* @param mixed $redirect The redirect type to be used (301/302) or false for returning the final URL as string | |
* |
#!/bin/bash | |
# Set this to your server's owner user (normally www-data) | |
user="www-data:www-data" | |
# Set this to the path to your wp-content | |
wp_content_path="/var/www/html/wp-content" | |
# Gets current year and month numbers | |
year=`date +%Y` |
#!/bin/sh | |
# Connects DisplayLink into Xrandr and sets it with 1920x1080 mode, so it can be recognized by kscreen or any other software | |
# Sources: | |
# - https://wiki.archlinux.org/index.php/DisplayLink | |
xrandr --setprovideroutputsource 1 0 | |
xrandr --output DVI-I-1-1 --mode 1920x1080 --right-of eDP-1 |
<?php | |
/* | |
Plugin Name: WP Managed MySQL 8 Fix | |
Plugin URI: https://gist.github.com/MatheusMK3/4f3acb29ac4fb0e9a03318bcacec1972 | |
Description: Fixes issues regarding MySQL modes (ONLY_FULL_GROUP_BY) when on managed database services. | |
Author: Matheus Pratta | |
Version: 1.0.0 | |
Author URI: https://matheus.io | |
*/ |
const https = require('https') | |
let cachedIndex = null | |
let cachedIndexHeaders = null | |
// Function to handle our OpenGraph tags | |
const handleOpenGraphUA = ['Twitterbot', 'Facebot', 'facebookexternalhit'] | |
const handleOpenGraph = (req, res) => { | |
// Check if we're serving Twitter or Facebook bots | |
const requestUA = req.headers['user-agent'] |
I hereby claim:
To claim this, I am signing this object:
function debounce (fn, time) { | |
// Estado do throttle | |
let throttling = false | |
// Retorna uma função especial para fazer o debounce | |
return () => { | |
// Se estiver com throttle ativo, retornar | |
if (throttling) return; | |
// Ativa o throttle |
/** | |
* Converts a string of text into an array of text blocks with a maximum size of blockSize. | |
* @author Matheus Pratta <eu@matheus.io> | |
* @param {string} text | |
* @param {int} blockSize | |
* @returns {array} | |
*/ | |
function textToCharBlocks (text, blockSize) { | |
let textBlocks = []; // Array containing our text blocks | |
let currentBlock = ''; // accumulator |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.20392156862745098</real> |
/** | |
* debug_object (1.0.0) | |
* Returns a complete human-readable breakdown of a Javascript object | |
* Author: Matheus Pratta <https://github.com/matheusmk3> | |
*/ | |
function debug_object (obj, braces, level) { | |
// Recursion level | |
if (!level) level = braces ? 1 : 0; | |
// Identation |