Skip to content

Instantly share code, notes, and snippets.

View changx03's full-sized avatar
🏠
Working from home

Luke Chang changx03

🏠
Working from home
  • The University of Auckland
  • Auckland
  • 20:17 (UTC +12:00)
View GitHub Profile
@changx03
changx03 / test.bash
Created April 16, 2025 22:46
bash example for matching 1 and 0
#!bin/bash
DEV=0
if [ "$#" -eq 1 ]; then
DEV="$1"
fi
# Expceting:
# bash ./test.bash 1 -> match
@changx03
changx03 / ping.py
Created December 5, 2024 00:55
Using Python subprocess to run ping command
import subprocess
# Using Popen for a long-running process or custom interaction
process = subprocess.Popen(
["ping", "www.google.com"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
shell=True,
)
@changx03
changx03 / conf.ros2
Created June 12, 2024 03:24
Color console outputs for ROS2 in grc
# Message after [WARN]
regexp=\[WARN\](?:.*\[.*\].*\[.*\]: )(.*)$
colours=bright_yellow
=====
# Message after [ERROR]
regexp=\[ERROR\](?:.*\[.*\].*\[.*\]: )(.*)$
colours=bright_red
=====
@changx03
changx03 / requirements.txt
Created May 19, 2024 07:38
A basic requirements file for Kivy 1.11.1 on Python 3.7
Kivy==1.11.1
Kivy-examples==1.11.1
opencv-python==4.9.0.80
@changx03
changx03 / .clang-format
Created May 7, 2024 06:17
Clang-Format for QGroundControl
# Based on Google style
BasedOnStyle: Google
# Set a large limit to avoid line wrapping
ColumnLimit: 0
# Keep include order and style
IncludeBlocks: Preserve
SortIncludes: false
@changx03
changx03 / settings.json
Created May 7, 2024 06:16
VS Code Settings for work
{
"editor.rulers": [
80,
120
],
"cmake.options.statusBarVisibility": "visible",
"cmake.showOptionsMovedNotification": false,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"git.autofetch": true,
@changx03
changx03 / foxglove.md
Created April 4, 2024 04:16
Instruction on running Foxglove V1 and recording ROS2 outputs
@changx03
changx03 / find_and_remove.bash
Created January 24, 2024 03:02
Find then remove
find . -name ".git" -exec rm -rvf {} \;

Create a clone image from a disk

Check device location:

lsblk 
@changx03
changx03 / .clang-format
Last active November 15, 2023 00:03
C++ format based on Microsoft
Language: Cpp
BasedOnStyle: Microsoft
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 130
SpaceBeforeParens: Never
ReflowComments: true
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true