This file contains 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
#!/bin/bash | |
## By Hebert F. Barros 2019 | |
## Removing any apt ## crashes | |
sudo rm /var/lib/dpkg/lock-frontend ; sudo rm /var/cache/apt/archives/lock ; | |
sudo apt-get update | |
echo 'installing curl' | |
sudo apt install curl -y |
This file contains 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
#deb cdrom:[Ubuntu 20.10 _Groovy Gorilla_ - Release amd64 (20201022)]/ groovy main restricted | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://br.archive.ubuntu.com/ubuntu/ groovy main restricted | |
# deb-src http://br.archive.ubuntu.com/ubuntu/ groovy main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://br.archive.ubuntu.com/ubuntu/ groovy-updates main restricted |
This file contains 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
# | |
# Github Actions for Serverless Framework | |
# | |
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings | |
# If you're using env.yml file, store its content as ENV Github secret | |
# | |
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD | |
# | |
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/ | |
# |
This file contains 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
#!/usr/bin/env pwsh | |
$Command = 'docker start' | |
$ContainerName = 'example', 'example2', 'example3' | |
foreach ($Container in $ContainerName) { | |
$Exec = $Command + ' ' + $Container | |
Invoke-Expression $Exec | |
} | |
Exit-PSSession |
This file contains 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
function getTimeRemaining(endtime) { | |
let time = Date.parse(endtime) - Date.parse(new Date().toDateString()); | |
const THOUSAND = 1000; | |
const HOURS_IN_DAY = 24; | |
const MINUTES_IN_HOUR = 60; | |
const SECONDS_IN_MINUTE = MINUTES_IN_HOUR; | |
let seconds = Math.floor(time / THOUSAND % SECONDS_IN_MINUTE); | |
let minutes = Math.floor( |
This file contains 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
type TypeGetTimeRemaining = { | |
total: number; | |
days: number; | |
hours: number; | |
minutes: number; | |
seconds: number; | |
}; | |
function getTimeRemaining(endtime: string): TypeGetTimeRemaining { | |
let time = Date.parse(endtime) - Date.parse(new Date().toDateString()); | |
This file contains 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 seq = [11, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]; | |
function sortNumbers(arrayOfNumbers: number[]) { | |
return arrayOfNumbers.sort((x, y) => x - y); | |
} | |
sortNumbers(seq); |
This file contains 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
#!/usr/bin/env pwsh | |
function Docker-Build() { | |
$AppName = Read-Host -Prompt "Enter the name of the application: " | |
$Executor = 'docker ' | |
$ExecutorArgs = 'build -t' | |
$GetArgsFinal = Read-Host -Prompt "Build to production OR development?: " | |
$ArgsFinal = '--target ' + $GetArgsFinal + ' .' | |
$Command = $Executor + $ExecutorArgs + ' ' + $AppName + ' ' + $ArgsFinal |
This file contains 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
name: Node.js CI on Darwin | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
build: |
This file contains 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 Intl from 'intl'; | |
import 'intl/locale-data/jsonp/pt-BR'; | |
export const moneyFormat = (value: number) => { | |
return new Intl.NumberFormat('pt-BR', { | |
style: 'currency', | |
currency: 'BRL', | |
}).format(value); | |
}; |
NewerOlder