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:
| /** | |
| * jQuery Image Optimizer | |
| * Lazy-loads images + background-images | |
| * by Matheus Pratta <https://github.com/MatheusMK3> | |
| */ | |
| window.optimize_images = () => { | |
| // Placeholder image, should be a 1x1 GIF in base64 | |
| var placeholder = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Google Chrome Popup Bypass</title> | |
| <script type="text/javascript"> | |
| /** | |
| * Fonte: Custom Chromium Build to Reverse Engineer Pop-Under Trick <https://www.youtube.com/watch?v=y6Uzinz3DRU> | |
| * Por algum motivo, os eventos "message" do Chrome são tratados como ações causadas pelo usuário, o que resulta na possibilidade de se criar popups infinitos, sem qualquer interação do usuário. | |
| * Também possibilita exibir mais de um popup a partir de cliques de mouse e até mesmo a criação de "popunder", um popup que fica abaixo da janela atual. | |
| */ |
| <?php | |
| /** | |
| * string find_best_match (string $word, array $db, float &$best_match_score); | |
| * Compares $word with each ocurrence in $db, then results the closest matching string. | |
| * Also returns how much both words matched in %. | |
| */ | |
| function find_best_match ($word, $db, &$best_match_score) { | |
| // Initialize our comparison variables | |
| $best_match = $word; | |
| $best_match_score = 0; |
| /** | |
| * 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 |
| <?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> |
| /** | |
| * 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 |
| 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 |
I hereby claim:
To claim this, I am signing this object:
| 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'] |