Skip to content

Instantly share code, notes, and snippets.

View haryandb's full-sized avatar

Haryan Dwi Baharna haryandb

View GitHub Profile
@lukepighetti
lukepighetti / .zshrc
Last active April 9, 2024 11:59
zsh functions I use for Helix / Flutter development
function flutter-watch(){
local PID_FILE="/tmp/tf$$.pid"
tmux new-session \;\
send-keys "flutter run --pid-file=$PID_FILE" Enter \;\
split-window -v \;\
send-keys "npx -y nodemon -e dart -x \"cat $PID_FILE | xargs kill -s USR1\"" Enter \;\
resize-pane -y 5 -t 1 \;\
select-pane -t 0 \;
rm $PID_FILE;
}
@Merwanski
Merwanski / cv_bridge_alternative.py
Created February 23, 2022 23:06
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()