Skip to content

Instantly share code, notes, and snippets.

View Dssdiego's full-sized avatar
🦄

Diego Santos Seabra Dssdiego

🦄
View GitHub Profile
@Dssdiego
Dssdiego / datatable.html
Created April 16, 2019 12:56
Datatable Angular
<ngx-datatable #table class="material ml-0 mr-0 mb-5" [rows]="rows" [columnMode]="'flex'" [headerHeight]="50" [footerHeight]="50"
[limit]="10" [rowHeight]="'auto'" [sorts]="[{prop: 'name', dir: 'desc'}]" [loadingIndicator]="loadingIndicator">
<ngx-datatable-column name="Avatar" prop="avatar" [flexGrow]="0.5">
<ng-template ngx-datatable-cell-template let-rowIndex="rowIndex" let-row="row">
<img src="{{row?.avatar}}" alt="" class="avatar-img">
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column name="Nome" prop="name" [flexGrow]="2">
<ng-template ngx-datatable-cell-template let-rowIndex="rowIndex" let-row="row">
{{ row?.name }}
<div fxLayout="row wrap">
<div fxFlex="100" fxFlex.gt-sm="25" fxFlex.sm="50">
<mat-card>
<mat-card-title>
<small class="text-muted">Despesas Fixas</small>
<span fxFlex></span>
<mat-chip class="icon-chip" color="accent" selected="true">
<mat-icon>trending_up</mat-icon>10%
</mat-chip>
</mat-card-title>
import { Component, OnInit } from '@angular/core';
import { MatSnackBar } from '@angular/material';
@Component({
selector: 'app-toast',
templateUrl: './toast.component.html',
styleUrls: ['./toast.component.scss']
})
export class Toast implements OnInit {
<div class="text-center">
<img class="mb-05" src="{{ image }}" alt=""/>
<h6 class="m-0 pb-1">{{ title }}</h6>
</div>
openPopUp(data: any = {}, isNew?) {
this.isPopupOpened = true;
let title = isNew ? 'Adicionar Item' : 'Editar Item';
let dialogRef: MatDialogRef<any> = this.dialog.open(PopUpComponent, {
width: '1024px',
disableClose: true,
data: { title: title, payload: data, editMode: !isNew }
})
dialogRef.afterClosed().subscribe(res => {
this.getItems();
import { Injectable } from '@angular/core';
import { MatDialog,MatSnackBar } from '@angular/material';
@Injectable()
export class AlertService {
constructor(
private snackBar: MatSnackBar
) { }
@Dssdiego
Dssdiego / .gitignore
Last active September 10, 2019 13:48
Android Gitignore
#built application files
*.apk
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
@Dssdiego
Dssdiego / Activity.kt
Last active April 1, 2020 14:32
MVC Pattern Android (Kotlin)
class Activity : AppCompatActivity(), Controller.View {
private val controller: Controller = Controller()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
controller.attachView(this)
}
@Dssdiego
Dssdiego / Timer.cs
Last active March 2, 2020 19:55
Unity Countdown Timer (MM:SS)
using System;
using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
[RequireComponent(typeof(TextMeshProUGUI))]
public class Timer : MonoBehaviour
{
private TextMeshProUGUI textUI;
@Dssdiego
Dssdiego / ColorChanger.cs
Created March 4, 2020 01:20
Unity Color Changer
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(Image))]
public class ColorChanger : MonoBehaviour
{
private Image _img;
private List<Color> _colors = Constants.Colors;
private int _minIndex;