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); | |
}; |
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 dateFormat = (value: number | Date | undefined) => { | |
if (value) { | |
const date = new Date(value); | |
return Intl.DateTimeFormat('pt-BR', { | |
year: 'numeric', | |
month: 'numeric', | |
day: 'numeric', |
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
export const getLastMonths = (many: number): string[] => { | |
const months = []; | |
const currentMonth = new Date().getMonth(); | |
for (let i = 0; i < many; i++) { | |
months.push( | |
new Date(new Date().setMonth(currentMonth - i)).toLocaleString( | |
'default', | |
{ month: 'short' }, | |
), | |
); |
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
// Armazenando dados: | |
meuObj = {nome: "Hebert", idade: 19, cidade: "Gyn"}; | |
meuJSON= JSON.stringify(meuObj ); | |
localStorage.setItem("testJSON", meuJSON); | |
// Recuperando dados: | |
text = localStorage.getItem("testJSON"); | |
obj = JSON.parse(text); | |
document.getElementById("demo").innerHTML = obj.name; |
NewerOlder