Skip to content

Instantly share code, notes, and snippets.

@SebastianGrans
SebastianGrans / MacOS_Software.md
Last active November 13, 2022 21:48
Various utility software that I use on MacOS

Update

I realized that almost all of these app can be installed easily via Brew. So first step would be to install Brew as instructed on their website.

Then simply run:

brew install iterm2 bettertouchtool bpython brave-browser vscodium vlc google-drive alt-tab git spotify monitorcontrol dozer
@SebastianGrans
SebastianGrans / README.md
Created January 13, 2022 16:58
Remapping the media keys to VS Code debug keys on MacOS

Remapping the media keys to VS Code debug keys on MacOS

I wanted to directly use the media keys to start debugging and stepping when working inside VS Code. This can be achieved using the app BetterTouchTool.

In BetterTouchTool I create a special

Essentially I create the following mapping:

@SebastianGrans
SebastianGrans / Monokai Pro (Filter Ristretto).itermcolors
Last active December 17, 2021 02:37
Monokai Pro (Filter Ristretto) for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.28337982296943665</real>
@SebastianGrans
SebastianGrans / Git commands.md
Last active December 3, 2021 19:47
Common git commands that I keep forgetting

Copy a branch from the original repo to a new branch on my fork

  1. Clone it:
    • git clone <url> <folder>
  2. Change origin url to my own fork:
    • git remote set-url origin <url>
  3. (Optional) Rename the branch
    • git branch -m <old> <new_branch_name>
  4. Push it to your repo
  • git push -u origin
@SebastianGrans
SebastianGrans / keygen.py
Created November 3, 2021 10:42
Keygen for VS Code extension Monokai Pro
#
# This is a key generator for the VS Code/Codium extension Monokai Pro
# https://marketplace.visualstudio.com/items?itemName=monokai.theme-monokai-pro-vscode
#
# If you like the extension, you should buy it.
#
# 1. Run this script. It will ask for your email (it doesn't have to be real)
# 2. Run `> Monokai Pro: enter license` from the command palette (ctrl+shift+p)
# 3. Enter the same email as in step 1, followed by the generated key.
# 4. DONE! :)
@SebastianGrans
SebastianGrans / debayer_with_torch.py
Created September 30, 2021 16:08
Debayering a BayerRG (RGGB) image using PyTorch
# This only works for BayerRG color filter arrays. I.e. RGGB
# Inspired by this: https://github.com/cheind/pytorch-debayer
#
# I just wanted a minimal implementation to understand it better.
#
import torch
import numpy as np
import matplotlib.pyplot as plt
@SebastianGrans
SebastianGrans / point_cloud2.md
Last active March 28, 2023 10:33
ROS2 port of the `point_cloud2.py` script from ROS1.

In ROS1 there was a script called point_cloud2.py that was accessible as a module in the sensor_msgs package. I.e. by running from sensor_msgs import point_cloud2. It provided various functions for creating PointCloud2 messages from lists, and vice versa.

I have "ported" it to ROS2 and submitted a PR, but it is currently under review: ros2/common_interfaces#128

I've decided to also place it here to make it more visible and accessible (if the google search algorithms work).

@SebastianGrans
SebastianGrans / pcd_subscriber_node.py
Created July 27, 2020 16:29
ROS2 Node that subscribes to PointCloud2 messages and visualizes them using Open3D.
import sys
import os
import rclpy
from rclpy.node import Node
import sensor_msgs.msg as sensor_msgs
import numpy as np
import open3d as o3d
@SebastianGrans
SebastianGrans / redirect-to-wikiwand-with-adguard.txt
Last active May 8, 2025 18:48
Emulate the behaviour of the Wikiwand extension in Safari 13 using an AdGuard JavaScript filter
# Since Safari 13 the Wikiwand plugin is no longer available and they
# don't even list Safari as a supported browser anymore.
#
# Most people use some kind of ad blocker, and personally I'm using "AdGuard for Safari" which allows you
# to define filters that inject javascript code on certain domains.
#
# Simply add this to AdGuards "User filter", and any wikipedia article will be redirected to Wikiwand.
#
@@||wikipedia.org^$generichide,badfilter
@SebastianGrans
SebastianGrans / Makefile
Last active March 6, 2018 12:18 — forked from jlintz/gist:1192247
Useful C debug macro.
DEBUG := n
CFLAGS := -std=gnu99 -Werror -Wall -Wno-deprecated-declarations
ifeq ($(DEBUG),y)
CFLAGS += -DDEBUG -g
endif
.PHONY: all clean