Skip to content

Instantly share code, notes, and snippets.

View yuricamara's full-sized avatar
🏠
Working from home

Yuri Camara yuricamara

🏠
Working from home
View GitHub Profile
@yuricamara
yuricamara / ng-universal.ts
Last active June 6, 2021 17:53
Angular Universal
const functions = require("firebase-functions");
import * as express from "express";
import {ngExpressEngine} from "@nguniversal/express-engine";
const {AppServerModule} = require("../dist/app/server/main");
const index = "../dist/app/browser/index";
const app = express();
@yuricamara
yuricamara / pop-with-params.ts
Last active May 4, 2018 01:21
Código do tutorial "Navegação pop com parâmetros — Ionic 2+"
popView(){
this.navCtrl.getPrevious().data.name = 'Flávio';
this.navCtrl.pop();
}
@yuricamara
yuricamara / push-with-params.ts
Last active May 4, 2018 01:22
Códigos do tutorial "Navegação pop com parâmetros — Ionic 2+"
pushView(){
this.navCtrl.push(ContactEditPage, {
userId: '123',
name: 'Pedro'
});
}
@yuricamara
yuricamara / show-and-hide-password.html
Last active May 3, 2018 15:00
Códigos do tutorial "Exibir e esconder senha — Ionic 2+"
<ion-input [type]="isTextFieldType ? 'text' : 'password'">
</ion-input>
<!--
Botão que ao ser pressionado, executa o método togglePasswordFieldType
que por sua vez inverte o valor da propriedade isTextFieldType
-->
<button (click)="togglePasswordFieldType()" >
<!--
Os valores 'eye-off' e 'eye' são nomes de ionicons.
@yuricamara
yuricamara / loading-service.ts
Created March 21, 2018 21:48
Loading Service
import { Injectable } from '@angular/core';
import { LoadingController, LoadingOptions, Loading } from 'ionic-angular';
@Injectable()
export class AcdLoadingService {
constructor(
public loadingCtrl: LoadingController
) {}
@yuricamara
yuricamara / validators.js
Last active July 7, 2017 15:55
Validators
'use strict';
// validators.js
const mongodb = require('mongodb');
const regex = require('./regex.helper');
const validator = require('validator');
module.exports = {
isArray: function(value) {
return Array.isArray(value);
@yuricamara
yuricamara / node-load.js
Last active August 27, 2016 20:12
MVC loadign without express-load
//server.js
require('../routes')(api);
//routes/index.js
//Carregamento das rotas
const filesNamesFromDirectory = require('../helpers/filesNamesHlp').fromDirectory;
const dir = require('path').join(__dirname, 'routes');
const filesNames = filesNamesFromDirectory(dir);
let route;
/**********************
[Page/Include]
**********************/
//Variáveis
//Placeholders
//Mixins (úteis apenas para este arquivo)
//Estilização do elemento que envolve a page/include
@yuricamara
yuricamara / dabblet.css
Last active August 29, 2015 14:02
Seletores irmãos
/**
* Seletores irmãos em CSS
*/
h1:hover + h2{
color:red;
} /* funciona */
h1:hover ~ h2{
font-size:14px;