Matheus Pratta MatheusMK3
- Nova Odessa, Brazil
- Sign in to view email
- https://matheus.io
View image-optimizer.js
/** | |
* 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'; |
View google-font-packager.php
<?php | |
/************************************************************************************************ | |
* Google Font Packager | |
* Version 1.0 (2018-02-11) | |
* by Matheus Pratta (https://github.com/matheusmk3) | |
*/ | |
if (!isset($argv[1])) | |
die ('Usage: google-font-packager.php [google-font-import-url [output-file.css]]'); |
View Keybase.gist
### 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 ASCmjAFCKokPiTDRDM9RhHwXtS0RX3qh2bb6EBfWYz4Vzgo | |
To claim this, I am signing this object: |
View cf7_cidades_estados.js
// Plugin de Cidade/Estado para ContactForm7 | |
// Por Matheus Pratta <eu@matheus.io> | |
// Uso: cf7_cidades_estados('#seletorEstado', '#seletorCidade'); | |
function cf7_cidades_estados (iEstado, iCidade) { | |
var base_dados = {"Acre":[{"id":79,"nome":"Acrelândia","estado_id":1,"created_at":null,"updated_at":null},{"id":80,"nome":"Assis Brasil","estado_id":1,"created_at":null,"updated_at":null},{"id":81,"nome":"Brasiléia","estado_id":1,"created_at":null,"updated_at":null},{"id":82,"nome":"Bujari","estado_id":1,"created_at":null,"updated_at":null},{"id":83,"nome":"Capixaba","estado_id":1,"created_at":null,"updated_at":null},{"id":84,"nome":"Cruzeiro do Sul","estado_id":1,"created_at":null,"updated_at":null},{"id":85,"nome":"Epitaciolândia","estado_id":1,"created_at":null,"updated_at":null},{"id":86,"nome":"Feijó","estado_id":1,"created_at":null,"updated_at":null},{"id":87,"nome":"Jordão","estado_id":1,"created_at":null,"updated_at":null},{"id":88,"nome":"Mâncio Lima","estado_id":1,"created_at":null,"updated_at":null},{" |
View whatever.css
/* Apply this to a class, so the object is always visible */ | |
.some-class { | |
box-shadow: inset 0px 0px 2px rgba(255,255,255,0.35), 0px 0px 2px rgba(0, 0, 0, 0.5); | |
} |
View array_multilevel.php
public static function array_multilevel (&$array, $name, $fn = null, $separator = '.') { | |
$name_tree = explode($separator, $name); | |
if (count($name_tree) > 1) { | |
$name_tree = array_reverse($name_tree); | |
$name = array_pop($name_tree); | |
$name_tree = array_reverse($name_tree); | |
$name_tree = implode($separator, $name_tree); | |
if (!isset($array[$name])) |
View Benchmark.php
<?php | |
namespace App; | |
class Benchmark { | |
private static $_times = []; | |
private static $_last_time = null; | |
private static $_last_name = null; | |
public static function run ($name = 'Unnamed Test') { |
View proxy.shoutcast.php
<?php | |
/* | |
-=- Script de proxy para SHOUTcast -=- | |
// v1.0 | |
Script original de referência: http://support.spacialaudio.com/forums/viewtopic.php?f=13&t=16858 |
View normalize.min.css
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0} |
View responsive.js
/* responsive.js (v. 1.0.0) | |
* by Matheus Pratta (matheus.io) | |
* Fixes the page scroll from "jumping" when the user scrolls from a mobile device which auto-hides the address bar. | |
* Note: for 100% height elements, instead of seeing a jump in the scroll, the user may see a jump on the element itself (mostly when it's vertically centered) | |
* Requires: jQuery | |
*/ | |
$(document).ready(function() { | |
$(window) | |
.scroll(function() { | |
window._scroll_pos = $(window).scrollTop(); |