Skip to content

Instantly share code, notes, and snippets.

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

Ismael Santana ismael3s

🏠
Working from home
View GitHub Profile
http:
routers:
app-01-root:
rule: "Path(`/`) || Host(`localhost`) || Host(`teste-webapp-gma2b9f2gac0dabm.canadacentral-01.azurewebsites.net`)"
priority: 1
service: app-01
app-01:
rule: "PathPrefix(`/app-01`) || HeaderRegexp(`Referer`, `.*app-01.*`)"
priority: 10
service: app-01
@ismael3s
ismael3s / fn.sql
Last active May 27, 2024 19:48
Calculate Working Hours between two dates in Postgres
create or replace
function calculate_working_hours(start_time TIMESTAMPTZ,
end_time TIMESTAMPTZ)
returns interval as $$
declare
date record;
minutes interval := interval '0 minutes';
begin
for date in
select
@ismael3s
ismael3s / aaa
Last active February 6, 2024 22:57
{
"version": "0.1.537",
"notes": "See the assets to download and install this version.",
"pub_date": "2024-02-06T22:34:48.324Z",
"platforms": {
"windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVTcHNHTU94TTZNZU5IbFNkVFFkWU14YVJncmwzU1hnOXJKVGhQeC9YL3ZXcVVlVWhsTjdrSHhUNzdqY09SeTJ4bWo4Smd3T1pNOVJnMXJ1dm5jVVpyeUpuWmxkQVpnT3djPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzA3MjU4ODc5CWZpbGU6QXJpc2VfMC4xLjUzNV94NjRfZW4tVVMubXNpLnppcAp4YnlNcm1GTW1mQTUxYjVUa25KbUlSeU9EL3pwZXBjTEhlTFpIVnpxT2RLVnN3c2lzSU5ScklFWHJtQmRha1Noc2hTRVJBNW94NUFDOFFDVnZqM3RBZz09Cg==",
"url": "https://github.com/ismael3s/dockerise/releases/download/v0.1.535.1/Arise_0.1.535_x64_en-US.msi.zip"
}
}
@ismael3s
ismael3s / static.json
Last active February 6, 2024 15:33
Arise - Tauri Updater
{
"version": "0.1.4",
"notes": "See the assets to download this version and install.",
"pub_date": "2024-02-06T15:12:10.282Z",
"platforms": {
"windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRQlFBRHprQnQ1QnFHcEtqakcxN1BjVnZnK3Nwb1dueVdERGE3b0hSQ25DOUhQMjVZWUdsa21WM0d1L1FhYURxZXljcC9hVGUweGpwcEtYQjh5ZDcrc2ZVV3J1U293ZEFvPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjg2NjMyMTQwCWZpbGU6RXpVcF8wLjEuOF94NjRfZW4tVVMubXNpLnppcAo4MS9STWpCaWkycS9OZXo0UUc0UElWNnVRZ0l5b3paME50VXJGQ2NRNTAzOG04YjErb3E5V2hNWkgxV3NjNVZOS09rcVRNNzQ1ZmVEWE00UU1NY1FEQT09Cg==",
"url": "https://github.com/ismael3s/dockerise/releases/download/v0.1.4.1/Arise_0.1.4_x64-setup.exe"
}
}
@ismael3s
ismael3s / WorkingTimeService.cs
Created April 7, 2023 20:30
Calculate Productive Time Between Two Date
namespace WorkingTime;
public class WorkingTimeService
{
public static TimeSpan CalculateProductiveHours(WorkingTimeParams workingTimeParams)
{
TimeSpan workingTime = TimeSpan.Zero;
workingTimeParams = workingTimeParams with
@ismael3s
ismael3s / some-test-.spec.ts
Created June 2, 2022 04:35
Typeorm recreate database on each test, your typeorm entity should be with all correct propertys
beforeAll(async () => {
await getConnection().synchronize(true)
})
afterEach(async () => {
await getConnection().synchronize(true)
})
@ismael3s
ismael3s / jest-integration-config.ts
Created June 2, 2022 04:29
Setup Prisma Test Envrioment
import { join } from 'path';
import { jest } from './package.json';
export default {
...jest,
preset: "ts-jest",
"testRegex": ".*\\.controller.spec\\.ts$",
"testEnvironment": join(__dirname, "./prisma/test-prisma.js")
};