Skip to content

Instantly share code, notes, and snippets.

View aleDsz's full-sized avatar
💜
Learning Rust

Alexandre de Souza aleDsz

💜
Learning Rust
View GitHub Profile
@showrav-ansary
showrav-ansary / Waybar module for monitoring nVidia GPUs.md
Last active January 15, 2026 20:02
this gist contains how to create a module for waybar to monitor nVidia GPUs.

Screenshot-20250109-181624.png
This custom module will require nvidia-smi installed as I have chosen to use it to pull real-time data. For icons to work correctly install nerd-fonts.

In your ~/.config/waybar/Modules you can choose to add these:

  • GPU Usage:
"custom/gpu-usage": {
    "format": "{}% {icon}",
    "format-icons": "󰾲",

I recommend using nix-starter-configs as a starting point. I use the "standard" template. It helps you set up some of these details, like overlays.

For structure I have a separate module for each nixos configuration, and each home manager configuration. Those don't contain a whole lot by themselves. Then I have a "common" module for nixos and for home manager for global configuration - I import that in each of the configuration-specific modules. Then I have lots of stuff split into small "feature" modules. Those I import either in the "common" modules, or on the configuration-specific modules.

External dependencies and overlays

Since you asked about setting up an external flake dependency I'll give an example I use. I use a window manager, niri, that I get from an external flake. I include the flake reference in inputs in flake.nix (source):

ni

@letThemPlay
letThemPlay / hm.nix
Created November 18, 2024 09:15
Stripped Down version of agenix home-manager setup with Env Vars
{
inputs,
stateVersion,
pkgs,
nixvim,
...
}:
{
imports = [ ./hmuser.nix ];
@WLSF
WLSF / http_server.ex
Created June 25, 2022 19:13
Web Server with Elixir
defmodule HTTPServer do
@moduledoc """
Este módulo é responsável por estabelecer uma conexão de servidor TCP
para suportar requisições HTTP.
Função principal: `start/1`
"""
defmodule Conn do
@moduledoc """
@jdecode
jdecode / dockerfile-for-php80-rc2-mysql-postgres.md
Last active December 19, 2024 08:14
Dockerfile for PHP 8.0 RC2 with MySQL and Postgres support
@valinet
valinet / README.md
Last active June 10, 2026 22:53
Get dark command windows all the time in Windows

Case study: Get dark command windows all the time in Windows

TL;DR

  1. Make a copy conhost.exe from System32.
  2. Open it with a hex editor (I use HxD).
  3. In HxD, go to Search - Find - Hex-values.
  4. Search for 881d9e530a004885c07477ff15b32e08009084c0.
  5. In Windows 10 version 2004, replace ff15b32e0800 with 909090909090. If using Windows 10 version 20H2, replace ff15b32e08009084 with 9090909090909090.
  6. Save file and copy it back to System32 (take ownership of original conhost.exe in order to replace it).
  7. Profit!
@EduardoRFS
EduardoRFS / arch-tutorial.md
Last active July 9, 2024 15:43
Adicionado set-locale

Resumo

  • criar partições
  • montar partições
  • instalar sistema
  • configurar hora
  • configurar rede
  • configurar localização
  • configurar usuario e sudo
  • configurar grub
@anabastos
anabastos / pipimaker.bat
Last active May 10, 2020 00:54
Meu primeiro Programa util 2014
rem Digite o numero e have fun
rem Nao suporta string nem floats então para de causar ae.
rem Fico imaginando o que foi o trabalho de vida de várias pessoas.
rem o cara que inventou a matemática booleana, depois teve os avanços no eletromagnetismo, as construções de maquinas analogicas e então digitais
rem anos de cooperação entre cientistas para criar os computadores, e linguagens de programação
rem fruto do trabalho conjunto da humanidade durante todo esse tempo
rem para chegar alguem e fazer um programa desses
@echo off
@mgwidmann
mgwidmann / ecto_polymorphism.ex
Last active September 29, 2020 14:45
Ecto Polymorphism
defmodule Ecto.Polymorphic do
defmacro __using__(_) do
quote do
require Ecto.Schema
import Ecto.Schema, except: [belongs_to: 2, belongs_to: 3]
import unquote(__MODULE__)
end
end
@izelnakri
izelnakri / company.ex
Last active May 28, 2024 15:00
ecto/elixir search functionality
# SELECT company,
# GREATEST(similarity(company.sourced_name, 'search term'), similarity(company.local_name, 'search term'), similarity(company.name, 'search term')) AS rank
# FROM "companies" company
# WHERE (similarity(company.sourced_name, 'search term') > 0.1::float) OR
# (similarity(company.local_name, 'search term') > 0.1::float) OR
# (similarity(company.name, 'search term') > 0.1::float)
# ORDER BY rank DESC
# LIMIT 5;
defmodule Company do