Skip to content

Instantly share code, notes, and snippets.

View fabriciobastian's full-sized avatar
👨‍💻

Fabricio Bastian fabriciobastian

👨‍💻
View GitHub Profile
@fabriciobastian
fabriciobastian / download-file.js
Created August 8, 2022 23:40
Download a file from a provided url
const http = require('http');
const https = require('https');
const fs = require('fs');
const chalk = require('chalk');
const yargs = require('yargs');
const { hideBin } = require('yargs/helpers');
const downloadFailed = errorMsg => {
fs.unlinkSync(tempFile);
console.error(chalk.red(`\u2717 Download failed: ${errorMsg}`));
@fabriciobastian
fabriciobastian / gh-dl-release
Created December 28, 2019 20:50 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@fabriciobastian
fabriciobastian / internalsVisibleTo.csproj
Created November 25, 2019 10:23
.NET framework internals visible to
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>%ASSEMBLYNAME%</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
@fabriciobastian
fabriciobastian / scrollbar.scss
Created November 15, 2019 10:08
Scrollbar styling
@mixin scrollbar-mixin() {
.mat-sidenav-content,
.mat-sidenav {
overflow-y: overlay !important;
}
.mat-sidenav-content:hover::-webkit-scrollbar,
.mat-sidenav:hover::-webkit-scrollbar {
display: initial;
}
@fabriciobastian
fabriciobastian / greaterThanValidator.directive.ts
Created October 14, 2019 12:54
Angular validation directive for template-driven forms
import { Directive, Input, OnChanges, SimpleChanges } from '@angular/core';
import { NG_VALIDATORS, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
@Directive({
selector: '[greaterThan]',
providers: [
{
provide: NG_VALIDATORS,
useExisting: GreaterThanValidator,
multi: true,