Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🚀

Fábio Vedovelli vedovelli

💭
🚀
View GitHub Profile
View factory-poc.js
import {mount, createLocalVue} from '@vue/test-utils';
import Vuetify from 'vuetify';
export function factory (component, propsData) {
const vuetify = new Vuetify();
const localVue = createLocalVue();
return mount(component, {
propsData,
localVue,
View vitor.code-workspace
{
"folders": [
{
"path": "."
}
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#007c27",
"titleBar.activeForeground": "#ffffff",
View Cypress-Mirage-config.js
Cypress.on("window:before:load", win => {
win.handleFromCypress = function(request) {
return fetch(request.url, {
method: request.method,
headers: request.requestHeaders,
body: request.requestBody
})
.then(res => {
return new Promise(resolve => {
res.json().then(body => {
View vedovelli-vsc-snipperts.json
{
"Vue Simple Component": {
"scope": "vue",
"prefix": "vsc",
"body": [
"<script>",
"export default {",
" name: '$1',",
"};",
"</script>",
View Classroom.spec.js
/* eslint-disable no-undef */
/// <reference types="cypress" />
const visitFirstVideo = () =>
cy.visit('/?class=o-que-ha-de-novo-no-vue-3-introducao');
const visitSecondVideo = () =>
cy.visit('/?class=o-que-ha-de-novo-no-vue-3-instalacao');
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View mirage-graphql-example.js
import { buildSchema, graphql } from "graphql";
// Construct a schema, using GraphQL schema language
let graphqlSchema = buildSchema(`
type Query {
recipes: [Recipe]
recipes_by_pk(id: Int!): Recipe
}
type Recipe {
id: ID!
@vedovelli
vedovelli / cloudSettings
Last active Mar 31, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-03-30T17:16:21.561Z","extensionVersion":"v3.4.3"}
View vue.http.plugin.js
import axios from 'axios'
const http = axios.create({
baseURL: 'http://localhost:8081'
})
export default function install (Vue) {
Object.defineProperty(Vue.prototype, '$http', {
get () {
@vedovelli
vedovelli / codigo-doido.js
Last active Mar 22, 2018 — forked from omariosouto/_codigo-doido-v2.js
Async, Recursive .... function!
View codigo-doido.js
async function awaitSubmissionFinish(submissionID, status) {
const response = await submissionInfo(submissionID)
if(status == 0) return response
return new Promise(resolve => {
setTimeout(() => resolve(awaitSubmissionFinish(submissionID, response.status)), 5000)
})
}