Skip to content

Instantly share code, notes, and snippets.

View rafaelromao's full-sized avatar

Rafael Romão rafaelromao

View GitHub Profile
@rafaelromao
rafaelromao / accents.dtsi
Last active May 5, 2024 22:04
Accented Letters for Portuguese in ZMK
/*
*
* Copyright (c) 2022 Rafael Romão
* SPDX-License-Identifier: MIT
*
*/
/ {
#define C_CEDIL (LA(ZMK_HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_C)))
@rafaelromao
rafaelromao / Roma 24
Last active March 13, 2024 20:26
Cosmos Roma
const options: Options = {
wallThickness: 4,
wallShrouding: 0,
webThickness: 0,
webMinThicknessFactor: 1,
screwIndices: [3, 10, 15, 16],
screwType: "screw insert",
screwSize: "M3",
screwCountersink: false,
rounded: {
@rafaelromao
rafaelromao / keymap.c
Last active September 1, 2022 13:29
Send CTRL on layer hold
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LT(1, KC_N):
// Intercept hold function to hold down CTRL on new layer
if (!record->tap.count) {
if (record->event.pressed) {
register_mods(MOD_LCTL);
} else {
unregister_mods(MOD_LCTL);
}
@rafaelromao
rafaelromao / secret.h
Last active May 30, 2022 18:49
Template for the secret.h
#pragma once
#include QMK_KEYBOARD_H
#include "definitions/keycodes.h"
#include "definitions/process_record.h"
#define SEC_1 KC_R
#define SEC_2 KC_Q
#define SEC_3 KC_P
#define SEC_4 KC_Z
@rafaelromao
rafaelromao / secret.c
Created May 30, 2022 18:37
Template for the secret.c
/*
* Secret stuff, should not be commited to the repo
*/
#include QMK_KEYBOARD_H
#include "secret.h"
// Combos
process_record_result_t process_secrets(uint16_t keycode, keyrecord_t *record) {
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;
import static java.util.stream.Collectors.toList;
@rafaelromao
rafaelromao / firacode.sh
Created July 25, 2020 18:23
Install firacode fonts
#!/usr/bin/env bash
fonts_dir="${HOME}/.local/share/fonts"
if [ ! -d "${fonts_dir}" ]; then
echo "mkdir -p $fonts_dir"
mkdir -p "${fonts_dir}"
else
echo "Found fonts dir $fonts_dir"
fi
@rafaelromao
rafaelromao / BuscapeAPISample.cs
Last active May 2, 2016 13:25
Buscapé API C# Sample
// Realiza a busca no Buscapé e trata os resultados
private async Task ExecuteSearchAsync(string uri, CancellationToken cancellationToken)
{
using (var request = new HttpRequestMessage(HttpMethod.Get, uri))
{
using (var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5)))
{
var buscapeResponse = await WebClient.SendAsync(request, cancellationTokenSource.Token);
if (buscapeResponse.StatusCode != HttpStatusCode.OK)
{