Skip to content

Instantly share code, notes, and snippets.

View danielbdias's full-sized avatar

Daniel Baptista Dias danielbdias

View GitHub Profile
@danielbdias
danielbdias / dbt-ai-agent-rules.md
Last active August 15, 2025 03:51
Cline rules to make Cline behaves like a dbt developer

You are dbt AI Agent, an expert analytics engineer. You utilize your skills and the dbt MCP server to answer questions about a user's dbt project and write new dbt models:

  • IMPORTANT Whenever creating a new dbt model, add every column value from the source table explicitly. Only if explicitly asked by the user or in the final CTE should you use select *. Utilize dbt show to learn what columns are available to you in the source.
  • IMPORTANT Whenever you generate SQL, use context from your discovery tools and the dbt project to suggest additional columns and data that the user can ask you to add to the current SQL.
  • IMPORTANT You can utilize your show tool to see sample rows from a query or data set. Use this data to refine your generated SQL and dbt models.
  • IMPORTANT You ALWAYS utilize the new Fusion engine, invoking dbt commands with dbtf, not dbt.
  • CAUTION Be aware that, while the Semantic Layer exists, it is not yet broadly implemented or adopted. Bias towards using your
#!/bin/bash
# <xbar.title>Internet check</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Daniel Dias</xbar.author>
# <xbar.author.github>danielbdias</xbar.author.github>
# <xbar.desc>Plugin to check network stability on your Mac.</xbar.desc>
# <xbar.image>http://www.hosted-somewhere/pluginimage</xbar.image>
# <xbar.dependencies>perl</xbar.dependencies>
@danielbdias
danielbdias / cart-pole-example.py
Created September 18, 2023 18:23
Example of Gymnasium usage using random actions
import gymnasium as gym
env = gym.make("CartPole-v1")
observation, info = env.reset(seed=42)
for iteration in range(1000):
action = env.action_space.sample() # this is where you would insert your policy
observation, reward, terminated, truncated, info = env.step(action)
print('Current iteration: ', iteration)
@danielbdias
danielbdias / install-tracetest-and-signos-on-k8s.sh
Created July 29, 2023 01:25
Installing Tracetest and Signos in a Kubernetes Cluster
# Installing Tracetest and Signoz on a Kubernetes cluster
k3d cluster create tracetest-signoz
cat << EOF > opentelemetry-collector-resources.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: collector-config
data:
@danielbdias
danielbdias / sync-git-repos.sh
Created September 8, 2022 17:05
Sync all Git repositories on a directory
#!/bin/sh
for code_directory in $(ls -d */)
do
# go to directory
cd $code_directory
code_directory_default_branch=$(git rev-parse --abbrev-ref origin/HEAD | sed 's@^origin/@@')
code_directory_current_branch=$(git rev-parse --abbrev-ref HEAD | sed 's@^origin/@@')
@danielbdias
danielbdias / ddd-third-iteration.rb
Created July 31, 2019 03:28
Pseudo programa mostrando a modelagem de um programa com DDD após a terceira iteração com um usuário.
class Endereco
# ...
end
class Rota
# ...
end
class GPS
def calcular_rota(endereco)
@danielbdias
danielbdias / ddd-second-iteration.rb
Created July 31, 2019 03:19
Pseudo programa mostrando a modelagem de um programa com DDD após a segunda iteração com um usuário.
class Coiso
# ...
end
class Rota
# ...
end
class GPS
def calcular_rota(coiso)
@danielbdias
danielbdias / ddd-first-iteration.rb
Last active July 31, 2019 03:17
Pseudo programa mostrando a modelagem de um programa com DDD após a primeira iteração com um usuário.
class Coiso
def ligar_com(treco)
# ...
Coisa.new
end
# ...
end
class Treco
# ...
@danielbdias
danielbdias / list-git-changed-files.sh
Last active February 12, 2019 21:47
Listing files that you changed in your current branch
# put here your main branch
MAIN_BRANCH=master
# command to list the files that you changed in your current branch and already commit to that branch
git --no-pager diff --name-only $MAIN_BRANCH
# and command to list the files that you changing right now
git status -s | awk '{if ($1 == "M" || $1 == "??") print $2}'
# execute both commands, concatenate the results and remove the duplicates
@danielbdias
danielbdias / simple-graphql-type.test.js
Created July 6, 2018 17:40
Test a resolve in one of the simple-graphql-type.js fields
const { expect } = require(‘chai’)
const MyCustomType = require(‘./MyCustomType’)
describe(‘MyCustomType test’, () => {
it(‘checks aCustomResolvedField #resolve’, () => {
const testObject = {
myStringField: 'hello',
innerValues: {
innerField: 'world'
}
}