Skip to content

Instantly share code, notes, and snippets.

View fernanDOTdo's full-sized avatar
🐵
Watch me code at twitch.tv/CodigoFalado

Fernando Santos fernanDOTdo

🐵
Watch me code at twitch.tv/CodigoFalado
View GitHub Profile
@fernanDOTdo
fernanDOTdo / file.js
Created August 20, 2020 21:04
gay pride console.log messages
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31px hsl(167.4, 100%, 5

Ganhadores de E-Book da Casa do Código

1 - STEVASC
2 - jpalvesl
3 - XandyCTz.
4 - djlaluna.
5 - Maxaxiii.
6 - Gabriel_Olivier.
7 - fa_do_joviron3.
8 - xurell.

@fernanDOTdo
fernanDOTdo / web-speech.js
Created February 1, 2020 04:00
Web Speech API - Falando o Elemento Clicado
// ⌨️ 🐒
// Carrega todas as vozes (útil para colocar em PT-BR)
var vozes;
window.speechSynthesis.onvoiceschanged = function() {
vozes = window.speechSynthesis.getVoices();
};
// 👀 Observa todos os elementos clicados no Body
document.querySelector("body").addEventListener("click", e => {
// 🔁 Evita Redirecionamento
@fernanDOTdo
fernanDOTdo / bootstrap.php
Created November 14, 2018 05:11
FacetWP Bootstrap 4 Custom Facet Type
<?php
/**
How to use this:
1 - Save this file under your WordPress Theme (like "yourtheme/facetwp/bootstrap.php")
2 - Include it in your functions.php (example: `include_once get_stylesheet_directory() . '/facetwp/bootstrap.php';`)
3 - Done! You should see "Bootstrap" as a Facet Type in your Facet Edit Page.
**/
@fernanDOTdo
fernanDOTdo / LocalValetDriver.php
Last active January 3, 2018 19:06
Valet Driver to work locally with Drupal projects from Acquia Cloud (just place this file on the project root folder)
<?php
class LocalValetDriver extends LaravelValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@fernanDOTdo
fernanDOTdo / query_string_javascript.js
Created December 22, 2017 16:44
Easy way to get Query String Values
var qs = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=', 2);
if (p.length == 1)
b[p[0]] = "";
else
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@fernanDOTdo
fernanDOTdo / gist:7592722
Created November 22, 2013 00:46
Instalando PHP 5.5, FPM, MongoDB e Nginx via MacPorts
$ sudo port install php55 php55-fpm php55-curl php55-gd php55-pcntl php55-mcrypt php55-iconv php55-soap php55-yaml php55-xdebug php55-openssl php55-mysql php55-pear php55-mongo php_select pear-PEAR
$ cd /opt/local/etc/php55
$ sudo cp php-fpm.conf.default php-fpm.conf
$ sudo cp php.ini-development php.ini
$ sudo vim php.ini
# date.timezone = 'America/Sao_Paulo' e cgi.fix_pathinfo = 0
$ sudo vim php-fpm.conf
# fazer alterações caso necessário
$ sudo port load php55-fpm
$ sudo port select php php55
@fernanDOTdo
fernanDOTdo / MNMP.sh
Created November 21, 2013 15:28 — forked from camshaft/MNMP.sh
#!/bin/bash
# vars
PHP_VERSION="5.3.6"
NGINX_VERSION="1.0.4"
MONGO_VERSION="1.8.1"
MEMCACHED_VERSION="1.4.5"
DIRECTORY=$(cd `dirname $0` && pwd)
PHP_DIR=$DIRECTORY/lib/php/$PHP_VERSION/
@fernanDOTdo
fernanDOTdo / gist:3974057
Created October 29, 2012 15:07
Formatar/Converter Segundos
function duration($sec){
return ($sec > 3599) ? gmdate('H:i:s', $sec) : gmdate('i:s', $sec);
}
echo duration(5000); // 01:23:20 -> 1 hora, 23 minutos, 20 segundos