Skip to content

Instantly share code, notes, and snippets.

View LucasJorgeHubert's full-sized avatar
👨‍💻
Coding

Lucas Jorge Hubert LucasJorgeHubert

👨‍💻
Coding
View GitHub Profile
@LucasJorgeHubert
LucasJorgeHubert / layout-orange.css
Last active January 8, 2019 16:32
Alterações RCI Admin
/*Line 695*/
.layout-wrapper .topbar .topbar-left {
padding: 17.5px 10px;
background-color: #f0f3f5;
}
/*Line 686*/
.layout-wrapper .topbar .logo {
width: 230px;
height: 40px;
@LucasJorgeHubert
LucasJorgeHubert / tabela.component.html
Created January 8, 2019 12:29
Table with angular material
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="codigo">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Código </th>
<td mat-cell *matCellDef="let row"> {{row?.codigo || '-'}} </td>
</ng-container>
<ng-container matColumnDef="descricao">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Descrição </th>
<td mat-cell *matCellDef="let row"> {{row?.descricao || '-'}} </td>
</ng-container>
@LucasJorgeHubert
LucasJorgeHubert / app.module.ts
Created December 12, 2018 18:54
Loading Angular
import { NgxLoadingModule, ngxLoadingAnimationTypes } from 'ngx-loading';
NgxLoadingModule.forRoot({
animationType: ngxLoadingAnimationTypes.pulse, // Aqui voce decide o estilo do loading ([ctrl]+[space])
backdropBackgroundColour: 'rgba(0,0,0,0.1)',
backdropBorderRadius: '4px',
primaryColour: '#008e57',
secondaryColour: '#008e57',
tertiaryColour: '#008e57'
})
@LucasJorgeHubert
LucasJorgeHubert / WeekPeriod.js
Created December 11, 2018 12:57
Para retornar o primeiro e o último dia da semana (domingo - sábado), com as datas completas, código mais didático possível.
// Instanciar a data de hoje
let today = new Date(); // Tue Dec 11 2018 10:54:05 GMT-0200 (Horário de Verão de Brasília)
// Instanciar a data de domingo da semana corrente
let firstDayOfWeek = new Date();
firstDayOfWeek.setDate(today.getDate() - today.getDay()/** 2 */);
firstDayOfWeek.setMonth(today.getMonth());
// Sun Dec 09 2018 10:54:05 GMT-0200 (Horário de Verão de Brasília)
// Instanciar a data de sábado da semana corrente
let lastDayOfWeek = new Date();
lastDayOfWeek.setDate(today.getDate() + (6 - today.getDay()/** 2 */));