This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package crud | |
| import ( | |
| "context" | |
| "github.com/google/uuid" | |
| ) | |
| type BasicCrudRepositoryInterface[T any] interface { | |
| Create(entity T) (T, error) | |
| GetPaginatedList(ctx context.Context, page, limit int, preloads []string, filters map[string]interface{}, sortFields []string) ([]T, int64, error) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package crud | |
| import ( | |
| "context" | |
| "github.com/google/uuid" | |
| "gorm.io/gorm" | |
| ) | |
| type BasicCrudRepository[T any] struct { | |
| DB *gorm.DB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package crud | |
| import ( | |
| "context" | |
| "github.com/google/uuid" | |
| "gorm.io/gorm" | |
| ) | |
| type BasicCrudRepository[T any] struct { | |
| DB *gorm.DB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('newrelic') | |
| const newrelicFormatter = require('@newrelic/winston-enricher') | |
| const express = require('express') | |
| const winston = require('winston') | |
| const logger = winston.createLogger({ | |
| level: 'info', | |
| format: winston.format.combine( | |
| winston.format.json(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** cadastro.Professor */ | |
| package cadastro; | |
| public class Professor { | |
| private final String nome; | |
| private final long matricula; | |
| public Professor(String nome, long matricula) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** cofrinho.Moeda */ | |
| package cofrinho; | |
| public class Moeda { | |
| private double valor; | |
| public Moeda(double valor) { | |
| this.valor = valor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const image = require('get-image-data') | |
| const jsqr = require('jsqr') | |
| image('./cupom3.jpg', (err, info) => { | |
| const code = jsqr(info.data, info.width, info.height) | |
| if (code) | |
| return console.log('found QR code :: ', code.data) | |
| return console.error('not found any qrcode in this picture') | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Exercícío 01 - Aula 2 | |
| Cálculo de números inteiros e reais | |
| """ | |
| n1 = int(input('informe o primeiro numero => ')) | |
| n2 = int(input('informe o segundo numero ==> ')) | |
| n3 = float(input('informe o terceiro numero => ')) | |
| calc1 = (n1*2) * (n2/2) | |
| calc2 = (n1*3) + n3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const countdown = async () => { | |
| for(let daysToEnd = 38; daysToEnd > 0; daysToEnd--) { | |
| console.warn(`${daysToEnd} remaining days to Edison make a shit`) | |
| } | |
| } | |
| const makeshit = async () => { | |
| console.error('Edilson can not do this anymore.') | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as io from 'socket.io-client'; | |
| import { environment } from 'src/environments/environment'; | |
| constructor() { | |
| this.socket = io.connect(environment.api.host, { transports: ['websocket'] }); | |
| this.socket.on('new:alert', () => { | |
| //do something | |
| }); | |
| } |
NewerOlder