Skip to content

Instantly share code, notes, and snippets.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
# Função para habilitar o Winget se não estiver habilitado
function Enable-Winget {
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
Write-Output "Winget não está instalado. Instalando..."
$progressPreference = 'silentlyContinue'
Write-Information "Downloading WinGet and its dependencies..."

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

DB_TYPE=mysql
DB_USERNAME=root
DB_PASSWORD=r00t14789632
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=nestjsdb
DATABASE_URL="${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_DATABASE}"
TYPEORM_CONNECTION=${DB_TYPE}
@joaohcrangel
joaohcrangel / aws-ec2-macos.sh
Created September 26, 2022 15:53
AWS EC2 MacOS
# Install and start VNC on the EC2 Mac instance:
sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
# Update the password for ec2-user
sudo passwd ec2-user
@joaohcrangel
joaohcrangel / Git Igore Remove Cache
Last active August 29, 2022 23:16 — forked from ainsofs/gist:2b80771a5582b7528d9e
Clear .gitignore cache
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
import { processFontFamily, useFonts } from 'expo-font';
import * as React from 'react';
import Svg, { SvgProps, G, Path, Rect, Text, TSpan } from 'react-native-svg';
import { useSchedulePaymentCrediCardFlip } from '../../../contexts/SchedulePaymentCrediCardFlipContext/useSchedulePaymentCrediCardFlip';
export function CreditCardBack(props: SvgProps) {
const { cvv, name } = useSchedulePaymentCrediCardFlip();
try {
useFonts({
import * as React from 'react';
import Svg, { SvgProps, G, Path, Text, TSpan, Rect } from 'react-native-svg';
import { useSchedulePaymentCrediCardFlip } from '../../../contexts/SchedulePaymentCrediCardFlipContext/useSchedulePaymentCrediCardFlip';
import { processFontFamily, useFonts } from 'expo-font';
export function CreditCardFront(props: SvgProps) {
const { number, expiry, name } = useSchedulePaymentCrediCardFlip();
useFonts({
Teko: require('../../../assets/fonts/Teko.ttf'),
});
@joaohcrangel
joaohcrangel / formatCurrency.ts
Created June 3, 2022 20:21
Format number to currency in TypeScript
export function formatCurrency(
initialValue: number,
options?: {
currency?: string;
precision?: number;
locale?: string;
}
): string {
const currencies = {
USD: '$',
const getRemaining = (value: number): number =>
value % 11 < 2 ? 0 : 11 - (value % 11);
type CheckSums = [number, number];
const generateCheckSums = (
numbers: Array<number>,
validators: Array<number>
): CheckSums => {
const initialCheckSums: CheckSums = [0, 0];
server {
server_name subdomain.domain.com.br;
error_page 500 502 503 504 /custom_50x.html;
location = /custom_50x.html {
root /usr/share/nginx/html;
internal;
}