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
int segundos = 86400; | |
int days = (segundos / 86400).floor(); | |
int hours = ((segundos - (days * 86400)) / 3600).floor(); | |
int minutes; | |
int seconds; | |
minutes = ((segundos - (days * 86400) - (hours * 3600)) / 60).floor(); | |
seconds = (segundos - (days * 86400) - (hours * 3600) - (minutes * 60)).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
SELECT | |
sum(sum(column)) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as accumulated | |
FROM | |
table | |
WHERE id_foo = ? |
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
<template> | |
<div> | |
<input ref="inputFile" type="file" accept="image/*" hidden @change="upload"> | |
<button @click="openInputFile">Upload</button> | |
<div> | |
<div v-show="view"> | |
<img id="imgFile" style="width: 600px; height: 400px" /> | |
<button @click="cleanInputFile"><i>×</i></button> | |
</div> | |
</div> |
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
SELECT | |
* | |
FROM | |
geo_located_data | |
WHERE | |
111.195 * sqrt(power(latitude-($1),2) + power(cos(pi()/180*($2))*(longitude-($2)),2)) < $3 |
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 "bytes" | |
func StreamToByte(stream io.Reader) []byte { | |
buf := new(bytes.Buffer) | |
buf.ReadFrom(stream) | |
return buf.Bytes() | |
} | |
func StreamToString(stream io.Reader) string { | |
buf := new(bytes.Buffer) |
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
sudo docker-compose -f docker-compose.yml build --no-cache --force-rm | |
&& sudo docker-compose -f docker-compose.yml up -d | |
&& sudo docker image prune -a -f |
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
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee | |
/etc/apt/sources.list.d/yarn.list | |
sudo apt update && sudo apt install yarn |
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 capturarPercentualTempoDecorridoPasso = (data_inicial: Date | null, data_final: Date | null, tempo_padrao: number): number => { | |
if (!data_inicial) { | |
return 0 | |
} | |
const hs3 = 10800 | |
const segundosTotal = tempo_padrao * 60 * 60 | |
const inicio = moment(data_inicial).unix() - hs3 | |
const fim = moment(data_final).unix() - hs3 |
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 makeSlug(value: string, separator?: string = '_'): string { | |
const mapAccentsHex: any = { | |
a : /[\xE0-\xE6]/g, | |
A : /[\xC0-\xC6]/g, | |
e : /[\xE8-\xEB]/g, | |
E : /[\xC8-\xCB]/g, | |
i : /[\xEC-\xEF]/g, | |
I : /[\xCC-\xCF]/g, | |
o : /[\xF2-\xF6]/g, | |
O : /[\xD2-\xD6]/g, |
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
SELECT | |
count(*) as total, | |
TO_CHAR(the_date_here, 'DD/MM') as create_at | |
FROM | |
tabela | |
WHERE | |
the_date_here::date > CURRENT_DATE - 7 | |
GROUP BY create_at | |
ORDER BY create_at ASC |
OlderNewer