Skip to content

Instantly share code, notes, and snippets.

View danroxha's full-sized avatar
🏠
Working from home

Daniel Rocha danroxha

🏠
Working from home
View GitHub Profile

My Profile

@danroxha
danroxha / obj.java
Last active January 11, 2024 22:53
StepBuilderExample
public class Obj {
private String value;
interface First {
Second first(String v);
}
interface Second {
Build second(String v);
}
interface Build {
Obj build();
@danroxha
danroxha / capture.c
Last active May 7, 2023 18:49
Tuner
#include <stdio.h>
#include <errno.h>
#include <math.h>
#include <signal.h>
#include <spa/param/audio/format-utils.h>
#include <pipewire/pipewire.h>
struct data {
struct pw_main_loop *loop;
struct pw_stream *stream;
@danroxha
danroxha / DecimaQuestao.java
Created March 23, 2023 04:21
Solução questão 10
class Banco {
private final String nome;
private final String agencia;
public Banco(String nome, String agencia) {
this.nome = nome;
this.agencia = agencia;
}
public String getNome() { return nome; }
@danroxha
danroxha / SextaQuestao.java
Last active March 23, 2023 02:58
Questão 6 - Use o Jshell para rodar
enum Formato {
JSON("JSON"),
XML("XML"),
CSV("PORCENTO");
private String content;
private Formato(String content) {
this.content = content;
enum TipoProduto() {
DIGITAL("digital", 1),
FISICO("fisico", 2);
private final String tipo;
private final int codigo;
private TipoProduto(String tipo, int codigo) {
this.tipo = tipo;
enum Nota {
CEM(100L),
CINQUENTA(50L),
VINTE(20L),
CINCO(5L);
private Long valor;
private Nota(Long valor) {
this.valor = valor;
@danroxha
danroxha / market.go
Created September 4, 2022 16:42
Exemplo de go routine
package main
import (
"fmt"
"math/rand"
"time"
"sync"
)
@danroxha
danroxha / main.c
Created July 16, 2022 13:50
Solução prova - 1Q
#include <stdio.h>
#define DIAS_DA_SEMANA 7
#define SAIR 0
// Faça um programa que leia a temperatura de uma cidade em uma semana. O
// programa deverá conter:
int main() {
float temparatura[DIAS_DA_SEMANA];
int temperatura_vazia = 0;
@danroxha
danroxha / .cz.yaml
Created June 30, 2022 16:44
Configuração Commitizen Tools
commitizen:
name: cz_customize
tag_format: v$version # v$major.$minor.$patch$prerelease"
version: 10.12.0
changelog_file: CHANGELOG.md
changelog_incremental: false
update_changelog_on_bump: false
use_shortcuts: false
allow_abort: false
annotated_tag: true