Skip to content

Instantly share code, notes, and snippets.

View coderdiaz's full-sized avatar
:shipit:
Think builder

Javier Diaz coderdiaz

:shipit:
Think builder
View GitHub Profile
<template>
<div class="abuelo-component">
<h1>Abuelo</h1>
<padre></padre>
</div>
</template>
<script>
import {EventBus} from './event-bus'
import Padre from './Padre' // Padre.vue
export default {
<template>
<div class="padre-component">
<h1>Padre</h1>
<hijo></hijo>
<button @click.prevent="emitirEventoPadre"></button>
</div>
</template>
<script>
import {EventBus} from './event-bus'
import Hijo from './Hijo' // Hijo.vue
<template>
<div class="hijo-component">
<h1>Hijo</h1>
<button @click.prevent="emitirEventoHijo"></button>
</div>
</template>
<script>
import {EventBus} from './event-bus'
export default {
name: 'Hijo',
<template>
<div class="card graph-card">
<h5 class="card-header">Usuarios activo e inactivos</h5>
<div class="card-body" v-loading="isLoading">
<div ref="chart"></div>
</div>
</div>
</template>
<script>
@coderdiaz
coderdiaz / npm-cheat-sheet.md
Created March 28, 2018 07:28 — forked from AvnerCohen/npm-cheat-sheet.md
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Prepand ./bin to your $PATH Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

@coderdiaz
coderdiaz / cmds.sh
Last active August 14, 2018 20:25
Docker Commands
# Start all dockers based on Id.
$ docker ps -a --format="{{.ID}}" | xargs docker [option](start | stop)
# Remove all docker containers
$ docker ps -a --format="{{.ID}}" | xargs docker rm -f
@coderdiaz
coderdiaz / index.js
Created August 18, 2018 19:10
Facker SQL for Sprotify
/*
* Getting Started
* $ yarn add mysql faker moment
* $ npm i -S mysql faker moment
* $ node index.js
*/
const mysql = require('mysql')
const faker = require('faker')
const moment = require('moment')
@coderdiaz
coderdiaz / index.js
Created August 18, 2018 20:02
Express API without best practices :v - Sprotify
const mysql = require('mysql')
const express = require('express')
const app = express()
app.use(express.json())
app.use(express.urlencoded({ extended: false }))
// Connection database
const connection = mysql.createConnection({
@coderdiaz
coderdiaz / dockers.sh
Last active January 26, 2019 20:03
My Containers
# Creating a MongoDB container with the mongo latest version.
docker pull mongo
docker run --name mongo-database -d -p 27017:27017 mongo --noauth --bind_ip=0.0.0.0
docker ps
# Creating a MySQL container with the mysql:5.7 version.
docker pull mysql:5.7
docker run -d -p 3306:3306 --name mysql-database -e MYSQL_ROOT_PASSWORD=root mysql:5.7
@coderdiaz
coderdiaz / app.js
Created December 20, 2018 03:29
App Vue
Vue.component('increment-button', {
props: {
count: {
type: Number,
default: 0,
},
},
template: `
<div>
<p>Count: {{ numberCount }}</p>