Skip to content

Instantly share code, notes, and snippets.

View odirleiborgert's full-sized avatar
💻
Working

Odirlei Borgert odirleiborgert

💻
Working
View GitHub Profile
<style lang="sass" scoped>
.app {
position : relative;
width : 100vw;
height : 100vh;
margin : 0 !important;
}
.appbar {
position : absolute;
@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");
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 / 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;
@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;
};

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)
@odirleiborgert
odirleiborgert / gulpfile.js
Created November 3, 2016 12:18 — forked from HPieters/gulpfile.js
BrowserSync Gulpfile
//load plugins
var gulp = require('gulp'),
compass = require('gulp-compass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
livereload = require('gulp-livereload'),

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@odirleiborgert
odirleiborgert / reset.less
Created July 27, 2016 19:03 — forked from joshuapowell/reset.less
LESS: Global LESS CSS reset that gives elements default formatting.
/**
* Global Reset of all HTML Elements
*
* Resetting all of our HTML Elements ensures a smoother
* visual transition between browsers. If you don't believe me,
* try temporarily commenting out this block of code, then go
* and look at Mozilla versus Safari, both good browsers with
* a good implementation of CSS. The thing is, all browser CSS
* defaults are different and at the end of the day if visual
* consistency is what we're shooting for, then we need to
@odirleiborgert
odirleiborgert / deploy.php
Created June 23, 2016 13:57 — forked from brunofonseca/deploy.php
Arquivo de Configuração deploy
<?php
require 'recipe/symfony.php';
server('NOME_SERVIDOR', 'IP_SERVIDOR', PORTA_SSH)
->user('USUARIO')
->forwardAgent()
->stage('PRODUCTION_DEVELOPMENT_TESTE')
->env('deploy_path', 'caminho');