Skip to content

Instantly share code, notes, and snippets.

View diegogurgel's full-sized avatar
😎
Always learning

Diego Gurgel diegogurgel

😎
Always learning
View GitHub Profile
@diegogurgel
diegogurgel / custom-card.html
Created August 18, 2014 05:18
webcomponents - flip-card
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<template id="custom-card">
<style>
:host{
font-family: 'Open Sans', sans-serif;
font-weight: 100;
}
.flip-container{
float: left;
margin: 0.5em;
@diegogurgel
diegogurgel / index.html
Created November 9, 2014 15:44
A Pen by Diego Gurgel.
<div class="host">
<div class="loading loading-0"></div>
<div class="loading loading-1"></div>
<div class="loading loading-2"></div>
</div>
@diegogurgel
diegogurgel / front-end-podcasts.md
Last active August 29, 2015 14:19
A collection of podcasts about front-end and web

#Front-End PodCasts

###The Web Ahead Conversations with world experts on changing technologies and future of the web. The Web Ahead is your shortcut to keeping up.

###Shop Talk Show An internet radio show about the internet starring Dave Rupert and Chris Coyier.

@diegogurgel
diegogurgel / layout_indicator.xml
Created July 2, 2015 14:47
layout_indicator.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 Jake Wharton
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
dependencies {
compile 'com.android.support:design:22.2.1'
}
@diegogurgel
diegogurgel / test.js
Created May 25, 2017 11:16
Testing promises with chai-as-promised - node v6.10.2
const chai = require('chai');
const expect = chai.expect;
chai.use(require('chai-as-promised'));
chai.should();
describe('Promises', function() {
it('Should be true', function() {
return Promise.resolve(true).should.eventually.equal(true);
});
@diegogurgel
diegogurgel / cpf-validator.ts
Last active September 1, 2017 15:02
Validação de CPF usando angular - CpfValidator.numberValidator() no seu campo do form group
import {AbstractControl} from '@angular/forms';
export const CpfValidator = {
numberValidator:function(){
return (control:AbstractControl):{[key:string]:any} =>{
let multipliers = [10,9,8,7,6,5,4,3,2]
let value = control.value.replace(/\D+/g, '');
if(value.length===11){
control.markAsTouched();
let total = value.split('').reduce((total, item) => {
@diegogurgel
diegogurgel / environment.md
Last active October 1, 2017 22:59
Ionic sacsis

Instalar vscode

https://code.visualstudio.com/

Instalar node

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

Instalar Ionic

var Foo = function () {
if(this instanceof Foo){
this.a = true;
this.b = 'hello';
this.c = 5;
} else {
return new Foo();
}
};
@diegogurgel
diegogurgel / mail.js
Created December 18, 2017 16:50
mail.js
'use strict';
const nodemailer = require('nodemailer');
const {smtp} = require('./config.json');
const smtpTransport = require('nodemailer-smtp-transport');
// Generate test SMTP service account from ethereal.email
// Only needed if you don't have a real mail account for testing
nodemailer.createTestAccount((err, account) => {
// create reusable transporter object using the default SMTP transport