Skip to content

Instantly share code, notes, and snippets.

View thebashpotato's full-sized avatar
⌨️
Probably debugging

Matt Williams thebashpotato

⌨️
Probably debugging
View GitHub Profile
@thebashpotato
thebashpotato / autostart.md
Created September 12, 2020 17:17
How to run autostart scripts on Gnome

Auto start

All these files can be found in my dotfile repo

# First we must create the script we want to execute
# scripts should be stored in your $HOME/.local/bin

# The code below is called 'essentials' in my repo
@thebashpotato
thebashpotato / seperate_ssh_keys.md
Created May 11, 2022 22:32
Setup seperate ssh keys for personal and work

Create your ~/.gitconfig

Here I use ~/Development/Github as my workspace, and create two sub folders for work and personal Note that if you want to use something different that ~/Development/Github, you must changed the paths in .gitconfig to match

# Contents of ~/.gitconfig
[includeIf "gitdir:~/Development/Github/personal/"]
    path = ~/Development/Github/personal/.gitconfig.pers
[includeIf "gitdir:~/Development/Github/work/"]
@thebashpotato
thebashpotato / blackjack.cpp
Last active May 13, 2023 21:27
Generic C++ enum class iterator.
/**
* The black jack code is from the youtube channel Dave's Garage.
* Here is the link to the video: https://youtu.be/b8V-WIjlScA
* Give him a like and subscribe, he makes great content.
*
* The link to Daves repository with the original code is here: https://github.com/davepl/blackjack
*
* In the video Dave does some manual iteration over a C style enum.
* At the time stamp 8:30 he says "One unfortunate part about C++
* is that it doesn't provide a way to get the lowest and highest values in an enumeration".
@thebashpotato
thebashpotato / ToolchainCortexA9.cmake
Created July 19, 2024 02:02
A CMake module to inject Cortex A9 poky toolchain into CMake build system
# ToolchainCortexA9.cmake
# This CMake module sets up the cross-compilation environment for Yocto/Poky toolchain.
# It can easily be adpated to any target architecture.
#
# Usage: cmake -D CMAKE_TOOLCHAIN_FILE=path/to/ToolchainCortexA9.cmake -B build
# Ensure the SYSROOTS environment variable points to the root of the Yocto/Poky SDK.
# Example: export SYSROOTS =/opt/poky/4.0.4/your-project/sysroots
if(NOT DEFINED ENV{SYSROOTS})
message(FATAL_ERROR "'SYSROOTS' environment variable is not set. Please set it in your .bashrc [E.G] 'export SYSROOTS =/opt/poky/4.0.4/your-project/sysroots/'")