Skip to content

Instantly share code, notes, and snippets.

View dleitee's full-sized avatar
🤠
coding

Daniel Leite de Oliveira dleitee

🤠
coding
View GitHub Profile
@dleitee
dleitee / gulpfile.babel.js
Last active September 21, 2015 21:06
gulp with es6
import gulp from 'gulp';
import stylus from 'gulp-stylus';
import uglify from 'gulp-uglify';
import imagemin from 'gulp-imagemin';
gulp.task('css', () => {
return gulp.src('./src/css/*.styl')
.pipe(stylus({
compress: true
}))
@dleitee
dleitee / gulpfile.js
Last active September 21, 2015 21:06
Initial gulpfile.js
var gulp = require('gulp');
gulp.task('default', function() {
// Código a ser executado.
});
@dleitee
dleitee / gulpfile.js
Created September 2, 2015 12:41
Basic Gulpfile.js
/*
Requisição dos plugins
*/
var gulp = require('gulp');
var uglify = require('gulp-uglify');
/*
Tarefa para minificar arquivos javascript
*/
gulp.task('minify', function() {
@dleitee
dleitee / slugfy.filter.js
Last active March 14, 2016 13:37
Javascript Slugify es2015
angular.module("filters")
.filter("slugfy", () => text => text.toString()
.toLowerCase()
.trim()
.replace(/\s+/g, "-") // Replace spaces with -
.replace(/&/g, "-and-") // Replace & with 'and'
.replace(/[^\w\-]+/g, "") // Remove all non-word chars
.replace(/\-\-+/g, "-") // Replace multiple - with single -
);
!function(){"use strict";var o,n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol?"symbol":typeof o};"object"===("undefined"==typeof module?"undefined":n(module))&&module.exports?(o=require("angular"),module.exports="ng-clipboard"):o=window.angular,o.module("ng-clipboard",[]),o.module("ng-clipboard").directive("ngCopy",["createFake",function(o){return{restrict:"A",scope:{ngCopy:"=",onSuccess:"=",onError:"="},link:function(n,e){var t=function(){n.onSuccess()},c=function(){n.onError()};e.on("click",function(){o(n.ngCopy,"copy",t,c)})}}}]),o.module("ng-clipboard").directive("ngCut",["createFake",function(o){return{restrict:"A",scope:{ngCut:"=",onSuccess:"&",onError:"&"},link:function(n,e){var t=function(){n.ngCut="",n.onSuccess()},c=function(){n.onError()};e.on("click",function(){o(n.ngCut,"copy",t,c)})}}}]),o.module("ng-clipboard").factory("createFake",function(){return function(o,n,e,t){var c=documen
@dleitee
dleitee / centralizar.md
Created April 4, 2016 14:56
Duas maneiras de centralizar um elemento com css.

position

Por ser compatível com browsers menos modernos, talvez essa seja a solução mais adequada na visão geral:

position: absolute;
top: 0; bottom: 0;
left: 0; right: 0;
margin: auto;

Exige altura fixa (height)

git config --global alias.co checkout 
git config --global alias.br branch 
git config --global alias.ci commit 
git config --global alias.st status
git config --global color.ui auto
tmuxa() { tmux a -t $1 }
.avatar-size {
max-width: 70px;
max-height: 70px;
height: 70px;
width: auto;
object-fit: cover;
}
const account = {
balance: 1000,
bank: '',
number: '',
}
const deposit = (account, value) => {
return {
...account,
balance: account.balance + value,