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
@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);
@PokeGuys
PokeGuys / Dockerfile
Last active August 15, 2019 16:09
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
@mhhansen
mhhansen / pwa-studio-setup-magento-230-alpha.txt
Last active October 19, 2019 08:10
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>/
@KerryRitter
KerryRitter / after.sh
Created October 4, 2017 01:46
Laravel+Homestead VSCode
#!/bin/sh
# Use as "after.sh" on the homestead repo and redo `vagrant reload --provision`.
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
wget https://xdebug.org/files/xdebug-2.5.5.tgz
tar xvzf xdebug-2.5.5.tgz
@skadimoolam
skadimoolam / checkbox.blade.php
Last active February 8, 2020 17:03
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>
@derickr
derickr / bench-rdp.php
Created June 27, 2020 09:50
PHP RDP Simplify Benchmark
<?php
$rounds = (int) $argv[1];
$callback = 'rdp_simplify';
if (! function_exists( $callback ) )
{
include 'rdp.php';
$callback = [ 'RDP', 'simplify' ];
}
@standa
standa / Mandrill.php
Created March 16, 2014 21:05
Mandrill CodeIgniter Library
<?php if (!defined('BASEPATH')) die();
/**
* This is a complete rewrite to use the Mandrill API instead of the
* weird thing that OpenCart people patched up in here.
*
* Inspired by Mindrill
* @link https://github.com/darrenscerri/Mindrill
*
* @author standa
@mauricesvay
mauricesvay / detector.js
Created January 9, 2014 10:23
Original js implementation of face detection
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
@martinsoender
martinsoender / responsive-image.liquid
Last active April 14, 2021 20:22
Responsive image snippet
{% comment %} Default images {% endcomment %}
{% assign PHONE_IMAGE = image %}
{% assign TABLET_IMAGE = image %}
{% assign DESKTOP_IMAGE = image %}
{% comment %} Default widths {% endcomment %}
{% assign PHONE_IMAGE_WIDTH = '640x' %}
{% assign TABLET_IMAGE_WIDTH = '768x' %}
{% assign DESKTOP_IMAGE_WIDTH = '1440x' %}