Skip to content

Instantly share code, notes, and snippets.

View odirleiborgert's full-sized avatar
💻
Working

Odirlei Borgert odirleiborgert

💻
Working
View GitHub Profile
@odirleiborgert
odirleiborgert / cars.js
Created December 16, 2016 00:17
Dúvidas com o Node.js
module.exports = function(sequelize, Sequelize){
var cars = sequelize.define('cars', {
brand: Sequelize.STRING,
model: Sequelize.STRING,
price: Sequelize.STRING,
});
return cars;
};
@odirleiborgert
odirleiborgert / service-searchcar.js
Created December 18, 2016 23:25
Dúvidas com React
import axios from 'axios';
const SearchCar = {
getByTerm() {
return axios.get(`http://localhost:3000/api/cars/search/uno/1`);
}
};
export default SearchCar;
import React from 'react';
import { Container, Divider, Card, Icon } from 'semantic-ui-react';
import axios from 'axios';
import SearchCar from './../services/SearchCar';
export default class App extends React.Component {
constructor(props) {
super(props);
@odirleiborgert
odirleiborgert / vue-filter.js
Created February 16, 2017 12:07 — forked from cagartner/vue-filter.js
VueJS filter slugable for friendly urls | Vuejs filtro para url amigáveis
Vue.filter('slugable', function(value) {
value = value.toLowerCase();
// faz as substituições dos acentos
value = value.replace(/[á|ã|â|à]/gi, "a");
value = value.replace(/[é|ê|è]/gi, "e");
value = value.replace(/[í|ì|î]/gi, "i");
value = value.replace(/[õ|ò|ó|ô]/gi, "o");
value = value.replace(/[ú|ù|û]/gi, "u");
value = value.replace(/[ç]/gi, "c");
value = value.replace(/[ñ]/gi, "n");
<style lang="sass" scoped>
.app {
position : relative;
width : 100vw;
height : 100vh;
margin : 0 !important;
}
.appbar {
position : absolute;
<script>
import Painel from '@/components/Painel'
import { Clients } from './../../resources/clients'
export default {
name: 'painel',
head: {
title: {
inner: 'Clientes'
}
@odirleiborgert
odirleiborgert / fileUtils.js
Created June 15, 2017 13:46 — forked from 11joselu/fileUtils.js
Donwload File - Vue.js 2.x
export function getFile(response) {
var result = document.createElement('a');
var contentDisposition = response.headers.get('Content-Disposition') || '';
var filename = contentDisposition.split('filename=')[1];
filename = filename.replace(/"/g,"")
return response.blob()
.then(function(data) {
result.href = window.URL.createObjectURL(data);
result.target = '_self';
@odirleiborgert
odirleiborgert / bot.js
Created December 6, 2017 15:35
Teste de bot
'use strict';
// Configs and Helpers
const config = require('./config');
// Modules import
let BlipSdk = require('blip-sdk');
let WebSocketTransport = require('lime-transport-websocket');
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@odirleiborgert
odirleiborgert / InputDate.vue
Created April 16, 2018 12:21 — forked from edilsoncichon/InputDate.vue
Vue JS component for the user to enter the date. Day, month and year are separated into inputs, to avoid problems with browser compatibility.
<template>
<div>
<select v-model="day" :name="idDay" :id="idDay" :disabled="disabled">
<option value="">day</option>
<option v-for="n in 31" :value="n">{{ n++ }}</option>
</select>
<select v-model="month" :name="idMonth" :id="idMonth" :disabled="disabled">
<option value="">month</option>
<option v-for="(month, key) in months" :value="key+1">{{ month }}</option>
</select>