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
@fhferreira
fhferreira / pwa-studio-setup-magento-230-alpha.txt
Created October 19, 2019 08:10 — forked from mhhansen/pwa-studio-setup-magento-230-alpha.txt
Magento PWA Studio setup with 2.3.0-alpha
################################################################
# NODE: 8.11.2
# NPM: 5.6.0 (I prob should upgrade this one)
# MySQL: 5.7
# PHP: 7.1
################################################################
################################################################
################################
### DOWNLOAD AND PREPARE MAGENTO TO INSTALL
# assuming you are in /<YOUR_PROJECT_FOLDER>/
@fhferreira
fhferreira / mysql-raw-command.sh
Created September 19, 2019 03:36
Raw Mysql Command Line
mysql -u <USER> --password=<PASSWORD> -e "select * from schema.table"
@fhferreira
fhferreira / AuthSocial.md
Created August 29, 2019 19:18 — forked from lucasmarques73/AuthSocial.md
Auth Social
// Rota para autenticacao customizada
r.POST("/custom-signin", ctrl.handleCustomSignIn)

Eu recebo no input

  • JWT Token da rede social(input.Token)
  • Qual rede social (input.Provider)
  • FederationID (input.GoogleID || input.FacebookID)
@fhferreira
fhferreira / nginx-proxy.conf
Created August 16, 2019 02:52
Proxy nginx to use Google Tag Manager
# Google Analytics Bypassing Adblockers
## Client
change www.googletagmanager.com => your.domain.com
```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://your.domain.com/gtag/js?id=UA-123456789-1"></script>
```
@fhferreira
fhferreira / Dockerfile
Created August 15, 2019 16:09 — forked from PokeGuys/Dockerfile
LEMP with Swoole
FROM php:7.2.8-fpm
RUN apt-get update && apt-get install -my wget gnupg
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get update && apt-get -y --no-install-recommends install apt-transport-https
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17
Magento 2 Debugging Tricks - MySQL Query, fetchAll, fetchRow, Data Hydrate & PHP xDebug by Matheus Gontijo
Video: https://www.youtube.com/watch?v=xLf3OwpAFhQ
-----------------------------------------------
1) Track MySQL queries
vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php::query
vendor/magento/zendframework1/library/Zend/Db/Select.php
@fhferreira
fhferreira / chart-responsivo.js
Created May 28, 2019 18:01 — forked from marpontes/chart-responsivo.js
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);
@fhferreira
fhferreira / link-between-messengers.php
Created May 20, 2019 23:16 — forked from mpociot/link-between-messengers.php
Use BotMan to link between multiple messenger services
@fhferreira
fhferreira / slugify.js
Created May 1, 2019 06:56 — forked from gabrielfroes/slugify.js
Javascript Slugify
/*
Create SLUG from a string
This function rewrite the string prototype and also
replace latin and other special characters.
Forked by Gabriel Froes - https://gist.github.com/gabrielfroes
Original Author: Mathew Byrne - https://gist.github.com/mathewbyrne/1280286
*/
if (!String.prototype.slugify) {
String.prototype.slugify = function () {
@fhferreira
fhferreira / checkbox.blade.php
Created March 23, 2019 19:40 — forked from skadimoolam/checkbox.blade.php
Customizable form partials for Laravel - https://laravelcollections.com
@php
$d = $d ?? null; // default value
@endphp
<div class="form-group row">
<label for="{{ $n }}" class="col-sm-4 col-form-label text-md-right"><b>{{ $l }}</b></label>
<div class="col-md-8">
<input id="{{ $n }}" type="checkbox" class="form-control" name="{{ $n }}" value="1" @if(old($n, $d) == '1') checked @endif>
@if ($errors->has($n))
<small class="text-danger">{{ $errors->first($n) }}</small>