Skip to content

Instantly share code, notes, and snippets.

View casgin's full-sized avatar

Gianfranco Castro casgin

View GitHub Profile
/*
Navicat Premium Data Transfer
Source Server : Laradock MySQL
Source Server Type : MySQL
Source Server Version : 50722
Source Host : localhost:3306
Source Schema : pyconx_dashboard
Target Server Type : MySQL
{
"totalCount": 43,
"labels": [
"2019-03-17",
"2019-03-23",
"2019-03-26",
"2019-03-27",
"2019-03-30",
"2019-03-31",
"2019-04-03",
{
"totalCount": 35,
"labels": [
"2019-04-16",
"2019-04-20",
"2019-04-26",
"2019-04-30",
"2019-05-01",
"2019-05-04",
"2019-05-05",
@casgin
casgin / ga-read-data.py
Created May 1, 2019 18:48
Codice di esempio per l'utilizzo delle Analytics Reporting API v4
"""Hello Analytics Reporting API V4."""
# from apiclient.discovery import build
from googleapiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
KEY_FILE_LOCATION = '<REPLACE_WITH_JSON_FILE>'
VIEW_ID = '<REPLACE_WITH_VIEW_ID>'
import { Component, OnInit } from '@angular/core';
// --- Importo NgForm
import { NgForm } from '@angular/forms';
@Component({
selector: 'app-root-form1',
template: `
<!--
Crero il form dove specifico con una TemplateReferenceVariabile
@casgin
casgin / computed-property.js
Created March 12, 2019 11:15
[VueMilan Meetup 2802] Computed Property "sommatoria"
computed: {
// --- Definisco la computed property
// --- Ogni volta che nel metodo "sommaNumero", avviene il .push
// --- sull'array (o ogni qualvolta avviene una modifica su questo array "this.elencoNumeri")
// --- viene invocata la funzione
sommatoria() {
let totale=0;
this.elencoNumeri.map(
@casgin
casgin / Sommatoria.vue
Created March 12, 2019 09:55
[VueMilan Meetup 2802] Codice del template del componente "Sommatoria"
<template>
<div>
<h1>Sommatoria</h1>
<fieldset>
<legend>{{titolo}}</legend>
<p>{{sottotitolo}}</p>
<input type="number" v-model="numeroInserito"
@keypress.enter="sommaNumero">
<button v-on:click="sommaNumero()">Add</button>
</fieldset>
// === Recupero del Token
$token = JWTAuth::getToken();
// --- logica del middleware
try {
// --- inoltra il token e verifica che sia corretto
$user = JWTAuth::toUser($token);
} catch (JWTException $e) {
@casgin
casgin / Oroscopo.vue
Created November 29, 2018 13:57
Componente Oroscopo - Laravel Day 2018
<template>
<div class="row">
<div class="col-md-6">
<!-- === menu segni === -->
<ul>
<li v-for="link in elencoSegni" v-bind:key="link.slug">
<button @click="dettaglioSegno(link.slug)">{{link.label}}</button>
</li>
</ul>
@casgin
casgin / Sommatoria.vue
Created November 29, 2018 12:32
Piccolo componente di esempio che mosta una computed property - LaravelDay 2018
<template>
<div>
<fieldset>
<legend>Sommatoria</legend>
<input type="text" v-model="numeroDaSommare" @keyup.enter="aggiungiNumero">
<button v-on:click="aggiungiNumero">Add</button>
</fieldset>
<!-- computed property --->