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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using AutoMapper; | |
| using AutoMapper.Internal; | |
| namespace Agenda.Application.Extensions | |
| { | |
| public static class AutoMapperExtensions |
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
| using System; | |
| using System.Security.Cryptography; | |
| namespace Infra | |
| { | |
| public class PasswordHasher | |
| { | |
| /// | |
| /// Return a string delimited with random salt, #iterations and hashed password |
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
| EXEC sp_MSForEachTable 'DISABLE TRIGGER ALL ON ?' | |
| EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' | |
| EXEC sp_MSForEachTable 'SET QUOTED_IDENTIFIER ON; IF OBJECT_ID(''?'') NOT IN (ISNULL(OBJECT_ID(''[dbo].[__EFMigrationsHistory]''),0)) DELETE FROM ?' | |
| EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' | |
| EXEC sp_MSForEachTable 'ENABLE TRIGGER ALL ON ?' |
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
| using Microsoft.AspNetCore.Authentication; | |
| using Microsoft.AspNetCore.Authentication.JwtBearer; | |
| using Microsoft.AspNetCore.Builder; | |
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.AspNetCore.Mvc.Testing; | |
| using Microsoft.AspNetCore.TestHost; | |
| using Microsoft.EntityFrameworkCore; | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.DependencyInjection.Extensions; |
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
| public class Test | |
| { | |
| private MailMessage TransformarImageBase64EmAnexo(MailMessage mailMessage) | |
| { | |
| string body = mailMessage.Body; | |
| var reg = new Regex("src=\"(data:image\\/[^;]+;base64[^\"]+)\""); | |
| var matches = reg.Matches(body); | |
| //var split = new Regex("src=\"").Split(match.Value).Where(s => !string.IsNullOrEmpty(s)).ToList(); | |
| foreach (Match match in matches) |
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 React from 'react'; | |
| import { Table, Form, Button, Col, Row, Spinner, Fade, Dropdown, DropdownButton, Pagination } from 'react-bootstrap'; | |
| import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | |
| import { faSearch, faPlusSquare, faSort, faSortUp, faSortDown, faTimes } from '@fortawesome/free-solid-svg-icons'; | |
| import { Link } from 'react-router-dom'; | |
| import { orderBy, chunk } from 'lodash'; | |
| const buildStringSearchRegex = (str) => { | |
| const strArray = Array.from(str); | |
| const regexArray = strArray.map(word => { |
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 { v4 } from 'uuid'; | |
| import * as arrayToTree from 'array-to-tree'; | |
| type Tranformer<TItem, TResult> = (item: TItem, level?: number) => TResult; | |
| export interface DataNode { | |
| UUID?: string; | |
| parentUUID?: string; | |
| children?: any[]; |
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
| protected void ToSnakeCase(ModelBuilder builder) | |
| { | |
| base.OnModelCreating(builder); | |
| foreach (var entity in builder.Model.GetEntityTypes()) | |
| { | |
| // Replace table names | |
| entity.Relational().TableName = entity.Relational().TableName.ToSnakeCase(); | |
| // Replace column names |
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 http = require('http'); | |
| const port = 3000; | |
| const ip = 'localhost'; | |
| const server = http.createServer((req, res) => { | |
| let data = ''; | |
| req.on('data', chunk => { | |
| data += chunk; | |
| }); |
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
| export const buildStringSearchRegex = (str: string): RegExp => { | |
| const strArray = Array.from(str); | |
| const regexArray = strArray.map(word => { | |
| if (word === 'a') { return '[à-úÀ-ÚaA]'; } | |
| if (word === 'e') { return '[à-úÀ-ÚeE]'; } | |
| if (word === 'i') { return '[à-úÀ-ÚiI]'; } | |
| if (word === 'o') { return '[à-úÀ-ÚoO]'; } | |
| if (word === 'u') { return '[à-úÀ-ÚuU]'; } | |
| return word; | |
| }); |
NewerOlder