Skip to content

Instantly share code, notes, and snippets.

View vedovelli's full-sized avatar
💭
🚀

Fábio Vedovelli vedovelli

💭
🚀
View GitHub Profile
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 March 22, 2018 11:56 — forked from omariosouto/_codigo-doido-v2.js
Async, Recursive .... function!
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)
})
}
import React from 'react'
import actions from '../store/actions'
import { connect } from 'redux-zero/react'
import PropTypes from 'prop-types'
require('./App.scss') // eslint-disable-line no-undef
const App = ({ error, children, resetError }) => (
<div>
# v2 syntax
version: '2'
# Named volumes
volumes:
# Redis Data
octimine2017vedovelli-redis-data:
driver: local
services:
####
# ATENTION:
# Replace all occurences of sandbox with your project's name
####
# v2 syntax
version: '2'
# Named volumes
volumes:
@vedovelli
vedovelli / happy-number.js
Last active November 22, 2017 22:10
Happy number resolution
// http://dojopuzzles.com/problemas/exibe/numeros-felizes/
const numberToAssert = 7
//************************
let iterationLimit = 200
const assertHappiness = input => {

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@vedovelli
vedovelli / publication.json
Created October 14, 2016 14:49
Structure of a publication document
{
"raw_publ_no": "EP0758583A2",
"publ_no": "<a href=\"http://worldwide.espacenet.com/searchResults?DB=worldwide.espacenet.com&amp;locale=en_EP&amp;query=EP0758583A2&amp;ST=singleline&amp;compact=false\" target=\"_blank\">EP0758583A2</a>",
"title": "Laminated glass with infrared radiation reflecting properties",
"linked_title": "<a href=\"http://worldwide.espacenet.com/searchResults?DB=worldwide.espacenet.com&amp;locale=en_EP&amp;query=EP0758583A2&amp;ST=singleline&amp;compact=false\" target=\"_blank\">Laminated glass with infrared radiation reflecting properties<i class=\"fa fa-external-link\"></i></a>",
"priority_date": "1995-08-16",
"publ_date": "1997-02-19",
"abstract": "In a laminated glass pane comprising two glass sheets (1, 2) and a transparent support film (4) having an infra red reflecting surface coating (3), connected to the two glass sheets (1, 2) by adhesive layers (5, 6), the first adhesive layer (5) has a thickness of at most about 50 .mu.m. The second adhesive layer
$svg = "<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg version="1.1" style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Arial, Helvetica, sans-serif;font-size:12px;" xmlns="http://www.w3.org/2000/svg" width="600" height="400"><desc>Created with Highcharts 4.2.5</desc><defs><clipPath id="highcharts-1"><rect x="0" y="0" width="600" height="400"/></clipPath></defs><rect x="0" y="0" width="600" height="400" fill="#FFFFFF" class=" highcharts-background"/><g class="highcharts-series-group"><g class="highcharts-series highcharts-series-0 highcharts-tracker" transform="translate(10,10) scale(1 1)" style="cursor:pointer;"><path fill="rgb(218,40,28)" d="M 386.42117941589436 89.15410763569923 L 386.42117941589436 102.27910763569923 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(7,124,217)" d="M 374.5187008326802 295.1598928846466 L 374.5187008326802 308.2848928846466 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="
\DB::listen(function ($query) {
$fullQuery = vsprintf(str_replace(array('%', '?'), array('%%', '%s'), $query->sql), $query->bindings);
$logString = "Connection: {$query->connectionName}
Execution time: {$query->time}ms
Query: ${fullQuery}
---------------------" . PHP_EOL;
\Storage::append('logs/queries.log', $logString);
});