Skip to content

Instantly share code, notes, and snippets.

View jjcodes78's full-sized avatar
🎯
Focusing

Jorge Gonçalves Junior jjcodes78

🎯
Focusing
View GitHub Profile
@jjcodes78
jjcodes78 / importLib.js
Last active September 1, 2016 15:16
Import and create a non-ready-webpack/browserify Lib to use with VueJs
import { entry as Foo } from 'bar'
function MyFoo (args..., someProp) {
this.someProp = Object.assign({}, Foo.prototype.prop, someProp)
return Foo.call(this, args...)
}
MyFoo.prototype = Foo.prototype
@jjcodes78
jjcodes78 / EventListener
Created September 2, 2016 02:39
EventListener snippet
const EventListener = {
/**
* Listen to DOM events during the bubble phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
listen (target, eventType, callback) {
@jjcodes78
jjcodes78 / adldap.md
Last active September 5, 2016 18:03
Configuração ADLDAP2 Laravel 5.3
@jjcodes78
jjcodes78 / docker-compose.yml
Created September 8, 2016 23:32
Docker compose file to Laravel Projects
####
# ATENTION:
# Replace all occurences of sandbox with your project's name
# Credits: http://github.com/codecasts/ambientum
####
# v2 sintax
version: '2'
# Named volumes
@jjcodes78
jjcodes78 / docker-compose.yml
Created September 9, 2016 01:22
Docker compose for Vuejs Projects
version: '2'
services:
#------------------------------------------------------------
# Web server - For live reload and development
# This environment can be used to run npm and node
# commands as well
# Credits: http://github.com/codecasts/ambientum
#------------------------------------------------------------
dev:
//***********************************************
// ESTABELECIMENTO MODEL
//***********************************************
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
<?php
/**
* Created by PhpStorm.
* User: Jorge
* Date: 27/03/2017
* Time: 13:31
*/
require 'vendor/autoload.php';
foreach ($tables as $table)
{
// $table->children(0) = primeiro TR
// $table->children(0)->children(0) - primeiro TD
if ($table->children(0)->children(0) != null)
{
// monta o array com as chaves para encontrar as tabelas
// o nome do indice atrelado aos dados obtidos
// e a função que é chamada para obter os dados de cada seção
//----------------------------------------------------------------
// metodo pra obter os dados do estabelecimento
function getIdentificacao($table)
{
$table = $table->nextSibling();
$identificacao = [];
foreach ($table->children() as $tr) {
// monta as $keys de origem de dados
$keys = [
function getCooperativas($table)
{
$coopTable = $table->nextSibling();
//percorre até a próxima tabela
do
{
$coopTable = $coopTable->nextSibling();
} while($coopTable->tag != "table");