Skip to content

Instantly share code, notes, and snippets.

View brccabral's full-sized avatar
🐔
Vamos, Galo! Ganhar o Brasileiro!

Bruno Cabral brccabral

🐔
Vamos, Galo! Ganhar o Brasileiro!
View GitHub Profile
@brccabral
brccabral / CustomTypefaceSpan.kt
Last active May 12, 2020 19:26 — forked from florina-muntenescu/CustomTypefaceSpan.kt
Style internationalized text using Annotations
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@brccabral
brccabral / 01_Control_Spotify_and_other_media.md
Last active January 26, 2023 08:19
Control Spotify with media keys in Ubuntu and other media players

Ubuntu keyboard media controls

I've just installed Spotify on my Ubuntu 20.04 Gnome 3.36.8 and I've found out that the media keys on my keyboard can't control Spotify. They control other media players just fine, only Spotify is not working. People say that this is a Spotify bug, but until they solve it I need it to be working.

I have found this post proposing to use a custom key binding to control Spotify. https://fabianlee.org/2016/05/25/ubuntu-enabling-media-keys-for-spotify/ This works! Except that to make it work I needed to disable the default behavior, thus I can control Spotify but I loose control over the other media players.

@brccabral
brccabral / 01_Nemo_actions.md
Last active March 16, 2023 18:20
Nemo actions

Nemo actions

Nemo is a free and open-source software and official file manager of the Cinnamon desktop environment. It is a fork of GNOME Files (formerly named Nautilus).

Nautilus is default in GNOME desktop, but although I use Ubuntu, which has GNOME as default, I don't like Nautilus.

Nemo has some features that works best for me, thus I decided to install Nemo on my Ubuntu GNOME.

  • Copy current path from the top bar
  • Right click option to open current folder as root (good to copy files to protected locations)
  • Create custom actions. This is the focus for this gist.
@brccabral
brccabral / 01_README.md
Last active April 11, 2024 01:13
VSCode VSCodium snippets and settings

VSCode VSCodium snippets and settings

Place the snippets at ~/.config/Visual Studio Code/User/snippets or ~/.config/VSCodium/User/snippets
Use "scope" to tell VSCode/VSCodium to use it in a specific language.

VSCode/VSCodium don't come with Python snippets. I am creating them as I need.

@brccabral
brccabral / 01_QGIS_Python.md
Last active October 13, 2022 01:49
QGIS and Python

QGIS and Python

QGIS comes with its own Python, but it is missing Tkinter DLLs.
Create a new .bat file to add PYTHONPATH to environment variables. Check if your installation is qgis or qgis-ltr.

C:\OSGeo4W\etc\ini\user.bat

SET PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python;%OSGEO4W_ROOT%\apps\qgis\python\plugins
SET PATH=%PATH%;%LOCALAPPDATA%\Programs\Microsoft VS Code
@brccabral
brccabral / 01_README.md
Created November 28, 2021 20:12
Code::Blocks settings

Code::Blocks settings

File default.conf contains my default settings and syntax highlights (color theme, based on dracula).
Not all languages have their highlights complete.

Place file default.conf in ~/.config/codeblocks

@brccabral
brccabral / 01_README.md
Last active September 24, 2022 02:20
Upload a Python package to Pypi.org

Upload a Python package to Pypi.org

@brccabral
brccabral / README.md
Last active September 11, 2022 19:02
Ubuntu 20.04 Wayland

Ubuntu 20.04 Wayland

  1. sudo apt install gnome-session-wayland
  2. Edit /etc/gdm3/custom.conf and comment WaylandEnable=false
  3. Edit /usr/lib/udev/rules.d/61-gdm.rules and comment all lines
  4. Edit /etc/default/grub and add "acpi_osi=Linux" into GRUB_CMDLINE_LINUX="acpi_osi=Linux"
  5. Reboot
  6. In login page, select Ubuntu on Wayland in the cogwheel
  7. sudo apt install qtwayland5
@brccabral
brccabral / .01_README.md
Last active March 27, 2024 03:50
Ubuntu Customizations

Ubuntu extensions and Softwares

On Ubuntu, initially your user may not be in sudo group

# enter as root
su -
# add your username into sudo group
usermod -aG sudo username
exit
# logout / log back in as username
@brccabral
brccabral / 01_SFML.md
Last active October 13, 2022 01:27
SFML Visual Studio Configurations

SFML Visual Studio Configurations

Menu Project >
    "Project" Properties >
        Configuration - Debug >
        Platform - Win32 or x64 >
            Configuration Properties >
                C/C++ >
                    General >