Skip to content

Instantly share code, notes, and snippets.

View daoran's full-sized avatar
🎯
Focusing

daoran

🎯
Focusing
View GitHub Profile
@daoran
daoran / ros_spinner.cc
Created December 15, 2023 02:48 — forked from hamzamerzic/ros_spinner.cc
[ROS] A spinner thread to force ros to spinOnce() and therefore ros services/callbacks to get invoked. Used for testing.
#include <ros/callback_queue.h>
#include <ros/ros.h>
#include <boost/thread.hpp>
/*
* @brief A spinner thread to force ros to spinOnce() and therefore ros services/callbacks to
* get invoked etc.
*/
class Spinner {
public:
@daoran
daoran / begin(C++).md
Created July 23, 2023 14:31 — forked from johnmcfarlane/begin(C++).md
Resources for C++ beginners
@daoran
daoran / private_fork.md
Created March 28, 2023 13:35 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@daoran
daoran / debian_from_ros_pkg.md
Created December 15, 2022 01:14 — forked from awesomebytes/debian_from_ros_pkg.md
How to create a debian from a ROS package
#!/usr/bin/env python
import sys
import roslib;
import rospy
import rosbag
from rospy import rostime
import argparse
import os
# Original:
@daoran
daoran / 99-usb-serial.rules
Created January 20, 2022 05:41 — forked from cbrake/99-usb-serial.rules
USB Serial udev rules
# /etc/udev/rules.d/99-usb-serial.rules
# udevadm info --attribute-walk -n /dev/ttyUSB0 |grep serial (can be used to get serial number)
# udevadm control --reload-rules (reload rules)
# udevadm trigger (re-add all devices)
# see https://wiki.archlinux.org/index.php/Bus_pirate
# for some reason, ATTRS{bInterfaceNumber}=="00" is not working, hence the use of ENV{}
# single USB/serial adapters
SUBSYSTEM=="tty", ATTRS{serial}=="A900TUKZ", SYMLINK+="ttyUSB_bub_1"
SUBSYSTEM=="tty", ATTRS{serial}=="A700fdWb", SYMLINK+="ttyUSB_bub_2"
@daoran
daoran / update-git.sh
Created November 3, 2021 02:01 — forked from YuMS/update-git.sh
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@daoran
daoran / gist:acfba023e00fc3537b16b5db57d14703
Created May 11, 2020 07:16 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@daoran
daoran / Eigen Cheat sheet
Created May 11, 2020 06:57 — forked from gocarlos/Eigen Cheat sheet
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.
@daoran
daoran / sugh.sh
Created April 15, 2020 10:58 — forked from erdincay/sugh.sh
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then