Skip to content

Instantly share code, notes, and snippets.

View fhferreira's full-sized avatar
🏠
Home-Office since 2005

Flávio H. Ferreira fhferreira

🏠
Home-Office since 2005
View GitHub Profile
@3runoDesign
3runoDesign / Procfile
Last active March 3, 2022 14:09
Deploy Heroku [Laravel 5.2.*]
web: sh app_boot.sh
worker: php artisan queue:listen
@vedovelli
vedovelli / gulpfile.js
Created June 3, 2015 17:20
Gulpfile.js para rodar duo() sempre que o javascript especificado for salvo.
/**
* gulpfile para automatizar a compilação feita com o Duo.js.
* Author: Fabio Vedovelli <vedovelli@gmail.com>
* http://vedovelli.com.br/
* Inspirado em https://github.com/mozilla/galaxy.js/blob/master/gulpfile.js
*/
var gulp = require('gulp');
/**
@JeffreyWay
JeffreyWay / ex.js
Created June 23, 2015 22:12
Laracasts.com Episode: Algolia + JavaScript + Vue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Algolia with JS</title>
<link rel="stylesheet" href="app.css">
</head>
<body>
@juliobitencourt
juliobitencourt / gist:bfd04e590f3fc8daf486
Last active February 9, 2018 19:06
Simple Previous and Next Navigation with Laravel Eloquent
<?php
namespace App\Domain\Repositories;
use App\Domain\Repositories\DbRepository;
use App\Domain\Entities\SomeEntity;
/**
*
*/
@marpontes
marpontes / chart-responsivo.js
Created November 24, 2015 19:51
Habilitando os gráficos do CDE a responderem a mudanças de layout.
/* [Dashboards compatíveis com requirejs]
Solução componente a componente
--------------------------------------------------------------------
Colocar no Post Execution:
*/
function(){
var comp = this, elm = $("#"+comp.htmlObject);
$(window).resize(function(){
comp.chart.options.width = elm.width();
comp.chart.render(/*bypassAnimation*/true, /*recreate*/true, /*reload*/false);
@subfuzion
subfuzion / curl.md
Last active June 14, 2024 07:00
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@guiwoda
guiwoda / AR_Cache_Repository.php
Last active February 25, 2023 21:11
AR (Eloquent) vs DM (Doctrine) gist
<?php
namespace App\ActiveRecord;
class PostRepository
{
private $cache;
public function __construct(Cache $cache)
{
// Any set() / get() cache implementation.
function telefone_validation(telefone) {
//retira todos os caracteres menos os numeros
telefone = telefone.replace(/\D/g, '');
//verifica se tem a qtde de numero correto
if (!(telefone.length >= 10 && telefone.length <= 11)) return false;
//Se tiver 11 caracteres, verificar se começa com 9 o celular
if (telefone.length == 11 && parseInt(telefone.substring(2, 3)) != 9) return false;
@guilhermeblanco
guilhermeblanco / debug-fpm-segfaut.md
Created June 8, 2016 15:59
Debugging PHP-FPM segfaults

Assuming PHP is compiled with debug enabled.

$ gdb /usr/sbin/php-fpm

Then:

r --nodaemonize --fpm-config /etc/php7/fpm/php-fpm.conf