Skip to content

Instantly share code, notes, and snippets.

View bruno-sartori's full-sized avatar

Bruno Sartori bruno-sartori

View GitHub Profile
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: padding-box, border-box;
}
@bruno-sartori
bruno-sartori / install_opencv_3.sh
Last active September 14, 2024 11:58
Install OpenCV 3 Ubuntu
######################################
# INSTALL OPENCV ON UBUNTU OR DEBIAN #
######################################
# -------------------------------------------------------------------- |
# SCRIPT OPTIONS |
# ---------------------------------------------------------------------|
OPENCV_VERSION='4.5.1' # Version to be installed
OPENCV_CONTRIB='NO' # Install OpenCV's extra modules (YES/NO)
# -------------------------------------------------------------------- |
@bruno-sartori
bruno-sartori / pre-push.sh
Last active September 8, 2024 17:57
Husky - Ensure semantic version
#!/bin/sh
yellow='\033[0;33m'
green='\033[0;32m'
blue='\033[0;34m'
red='\033[0;31m'
no_color='\033[0m'
ABORT_IF_ANY_VERSION_WAS_NOT_UPDATED=0
ABORT_IF_MAJOR_VERSION_WAS_NOT_UPDATED=1
@bruno-sartori
bruno-sartori / deepRequired.ts
Created August 24, 2024 15:09
Clone interface with optional parameters but make them required
interface IOptionalPropertiesSubInterface {
width?: number;
height?: number;
opacity?: number;
lineHeight?: number;
}
interface IOptionalPropertiesInterface {
enabled?: boolean,
visual?: boolean,
@bruno-sartori
bruno-sartori / VastSkippableWithPercentageOffset.xml
Last active August 1, 2023 11:53
VastSkippableWithPercentageOffset.xml
<?xml
version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0">
<Ad id="5926628810">
<InLine>
<AdSystem>GDFP</AdSystem>
<AdTitle>External - Single Inline Linear Skippable</AdTitle>
<Description><![CDATA[External - Single Inline Linear Skippable ad]]></Description>
<Error><![CDATA[https://pubads.g.doubleclick.net/pagead/interaction/?ai=BZb1PbrrHZKC8KY_-1sQPqLCCsA6f4LWVRgAAABABII64hW84AViV8drBgwRgzeDugKwDugEKNzI4eDkwX3htbMgBBcACAuACAOoCLi8yMTc3NTc0NDkyMy9leHRlcm5hbC9zaW5nbGVfcHJlcm9sbF9za2lwcGFibGX4AoXSHoADAZADnASYA-ADqAMB4AQB0gUGEMrbhIoWkAYBoAYjqAeaBqgH89EbqAeW2BuoB6qbsQKoB4OtsQKoB_-esQKoB9-fsQLYBwHgBwHSCBQIgGEQARgdMgKKAjoCgEBIvf3BOtgIAoAKBZgLAdAVAfgWAYAXAQ&sigh=F-LReR2H6nw&label=videoplayfailed[ERRORCODE]]]></Error>
<Impression><![CDATA[https://securepubads.g.doubleclick.net/pcs/view?xai=AKAOjstAjJgrbL4J986AGWDaSHo3IOXtd0SuRudr-Cz4uQPFuoKnt_kayaujag
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vmap:VMAP xmlns:vmap="http://www.iab.net/vmap-1.0" version="1.0">
<vmap:AdBreak breakId="293" breakType="linear" timeOffset="2%">
<vmap:AdSource allowMultipleAds="true" followRedirects="true" id="1">
<vmap:AdTagURI templateType="vast3">
<![CDATA[ https://gist.githubusercontent.com/bruno-sartori/cec775251457caaf478115d5fd185b4c/raw/6a9a7f7562e1c0fbd0db8b1d8272895133984570/VastIconExample.xml ]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
<vmap:AdBreak breakId="602" breakType="linear" timeOffset="50%">
<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd"
version="3.0">
<Ad id="5925573263">
<InLine>
<AdSystem>GDFP</AdSystem>
<AdTitle>External - Single Inline Linear</AdTitle>
<Description>
<![CDATA[ External - Single Inline Linear ad ]]>
</Description>
@bruno-sartori
bruno-sartori / RedisCache.js
Created February 23, 2023 13:05
RedisCache
import { RedisClient, createClient } from "redis";
import { env } from "../env";
/*
Usage:
// Define the cache
const cache = new RedisCache(60);