Skip to content

Instantly share code, notes, and snippets.

View guigaoliveira's full-sized avatar
✌️
writing fast, safe and concurrent code

Guilherme Oliveira guigaoliveira

✌️
writing fast, safe and concurrent code
View GitHub Profile
import { Histogram } from 'prom-client';
import { PrometheusDriver } from 'prometheus-query';
function buildMetricName() {
return `in_pix_decoded_pix_duration_milliseconds`;
}
function resetHistogram(name: string) {
const histogram = register.getSingleMetric(name) as Histogram;
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
defmodule Solutions do
@moduledoc false
@doc """
"turma de elixir formacao elixir de elixir"
%{"turma" => 1, "de" => 2, "elixir" => 3, "formacao" => 1}
"""
def get_words_occurrence(sentence) do
sentence
|> String.split()

Instalar o git

sudo add-apt-repository ppa:git-core/ppa  
sudo apt update
sudo apt install git

Instalar o flatpak

sudo apt install flatpak
sudo apt install gnome-software-plugin-flatpak
const getState = () => ({
labels: [
'Red',
'Green',
'Yellow',
'Surprise'
],
datasets: [{
data: [0, 0, 0, 0],
backgroundColor: [
const getState = () => ({
labels: [
'Red',
'Green',
'Yellow',
'Surprise'
],
datasets: [{
data: [0, 0, 0, 0],
backgroundColor: [
#include <iostream>
#include <unistd.h>
#include <math.h>
#include <sys/time.h>
using namespace std;
// função para simular carregamento da CPU
void carga(int k)
{
import React, { useState } from 'react'
const SimpleButton = ({ onClick, children }) => (
<button onClick={onClick}>{children}</button>
);
function Counter() {
const [count, setCount] = useState(0);
const increment = () => {
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:import/typescript',
'plugin:jest/recommended',
'plugin:security/recommended',
#include <avr/io.h>
#include <util/delay.h>
#define F_CPU 16000000UL
void mySerialBegin(int baudRate) {
UCSR0B |= (1 << RXEN0) | (1 << TXEN0); // Turn on the transmission and reception circuitry
UCSR0C |= (1 << UCSZ00) | (1 << UCSZ01); // Use 8-bit character sizes
UBRR0H = (baudRate >> 8); // Load upper 8-bits of the baud rate value into the high byte of the UBRR register
UBRR0L = (((F_CPU / (baudRate * 16UL))) - 1); // Load lower 8-bits of the baud rate value into the low byte of the UBRR register