Skip to content

Instantly share code, notes, and snippets.

View erickvieira's full-sized avatar
👨‍🎓
Software Engineer - UFG 2021

Erick Vieira erickvieira

👨‍🎓
Software Engineer - UFG 2021
View GitHub Profile
@erickvieira
erickvieira / deepcode.md
Created June 18, 2026 16:41
deepcode — Headroom proxy wrapper for DeepSeek + Zen (agent-executable setup guide + script)

deepcode — Headroom Proxy Wrapper for DeepSeek + Zen

Audience: AI agent or human setting up opencode with Headroom compression proxy in front of DeepSeek (chat) and OpenCode Zen (agent/models) providers.

Pattern: Minimal config — only options.baseURL + variants. No apiKey, no npm, no manual models. Auth from auth.json.

Created: 2026-06-16 | Updated: 2026-06-17 Source: headroomlabs-ai/headroom#74

@erickvieira
erickvieira / opencodex.md
Created June 18, 2026 16:17
opencodex — Headroom proxy wrapper for corporate OpenAI. Agent-executable setup guide.

Headroom Proxy Wrapper for OpenAI — Agent Setup Guide

Audience: AI agent on a machine where opencode is already installed and an OpenAI provider is already configured via /connect. Goal: Create ~/.local/bin/opencodex — launches opencode with all OpenAI traffic routed through Headroom compression proxy. Pattern: Minimal config — only options.baseURL + variants. No apiKey, no npm, no manual models. Auth from auth.json.


@erickvieira
erickvieira / micmute.workflow
Last active July 12, 2022 12:28
Automator service for microphone mute key binding on Mac OS
on run {input, parameters}
set inputVolume to input volume of (get volume settings)
if inputVolume < 60 then
set inputVolume to 60
set displayNotification to "Microphone is unmuted"
set speechMessage to "unmuted"
else
set inputVolume to 0
set displayNotification to "Microphone is muted"
@erickvieira
erickvieira / SQL-IN-Groovy.sql.groovy
Created January 31, 2022 19:06
SQL-IN-Groovy Datagrip extractor
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col) }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
inline fun <I, reified O> I?.convert(): O? = this?.let { input ->
try {
Gson().let { gson ->
gson.toJson(input).let { output ->
gson.fromJson(output, object : TypeToken<O>() {}.type)
}
}
@erickvieira
erickvieira / TheUltimateSearchInput.tsx
Last active May 18, 2021 22:48
THE ULTIMATE ANTD SEARCH INPUT (autocomplete, react, antd, antdesign, ant design, search, dynamic)
import React, { useCallback, useMemo, useState } from "react";
import { AutoComplete, Empty } from "antd";
import { debounce, get } from "lodash";
import { MaterialIcon } from "icons";
import { mdiLoading } from "@mdi/js";
import Text from "components/Text";
import useMountEffect from "hooks/Lifecycle/useMountEffect";
export interface SearchInputProps<T extends Dict> {
@erickvieira
erickvieira / AntD4FormExample.tsx
Last active April 28, 2021 16:08
Exemplo de implementação de um form não controlado com AntD 4.x
import { mdiDeleteForever } from "@mdi/js";
import { Form, Input, Space, Divider, Button } from "antd";
import MaterialIcon from "components/MaterialIcon";
import { Rule } from "rc-field-form/lib/interface";
// Estabelecendo uma interface simples para servir de objeto de estudo
interface Example {
displayName: string;
topics: string[];
user: {
@erickvieira
erickvieira / TagsCloud.styled.tsx
Last active April 12, 2021 21:17
AntD TagsCloud Component with StyledComponents
import React from 'react';
import styled, { css } from 'styled-components';
export interface TagsWrapperProps extends React.HTMLAttributes<HTMLDivElement> {
collapsed?: boolean;
uncollapsedHeight?: number | string;
}
const handleCollapse = (props: TagsWrapperProps) => css`
max-height: ${props.collapsed
@erickvieira
erickvieira / useSharedState.ts
Last active October 26, 2020 13:41
ReactJS Hook to create a RxJS based state and share it between React.FC components. No matters what level the state had been created, it will be available on whole app scope due to the BehaviorSubject. Read more about this approach here: https://medium.com/@thomasburlesonIA/https-medium-com-thomasburlesonia-react-hooks-rxjs-facades-4e116330bbe1 |
import { BehaviorSubject } from "rxjs"; // remember to install rxjs dependency
import { useCallback, useEffect, useState } from "react";
import { skip } from "rxjs/operators";
const globalSubject = new BehaviorSubject<any>({});
type SetSharedStateAction<S> = (state: S) => void;
export default function <T>(
subject: BehaviorSubject<T> = globalSubject
@erickvieira
erickvieira / sequenciaMaximal.c
Last active October 5, 2020 00:14
Sequência maximal de um array de inteiros.
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// = IMPLEMENTACAO DE ARRAY DINAMICO ===========================================
typedef struct {
int *arranjo;
size_t quantidadeDeElementos;