Skip to content

Instantly share code, notes, and snippets.

View haryandb's full-sized avatar

Haryan Dwi Baharna haryandb

View GitHub Profile
@haryandb
haryandb / cv_bridge_alternative.py
Created April 4, 2024 15:42 — forked from Merwanski/cv_bridge_alternative.py
Alternative for the `cv_bridge` python library two most used functions.
# initial code from https://github.com/ros-perception/vision_opencv/blob/noetic/cv_bridge/python/cv_bridge/core.py
import cv2
import numpy as np
import sensor_msgs
def cv2_to_imgmsg(cvim, encoding="passthrough", header=None):
if not isinstance(cvim, (np.ndarray, np.generic)):
raise TypeError('Your input type is not a numpy array')
# prepare msg
img_msg = sensor_msgs.msg.Image()
@haryandb
haryandb / .zshrc
Created February 25, 2024 08:37 — forked from lukepighetti/.zshrc
zsh functions I use for Helix / Flutter development
function flutter-watch(){
tmux new-session \;\
send-keys 'flutter run --pid-file=/tmp/tf1.pid' Enter \;\
split-window -v \;\
send-keys 'npx -y nodemon -e dart -x "cat /tmp/tf1.pid | xargs kill -s USR1"' Enter \;\
resize-pane -y 5 -t 1 \;\
select-pane -t 0 \;
}
function hx-find(){
@haryandb
haryandb / tmux.md
Created April 17, 2023 03:36 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a