Skip to content

Instantly share code, notes, and snippets.

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@qlibp
qlibp / CMakeLists.txt
Created July 6, 2023 06:21 — forked from sonictk/CMakeLists.txt
cmake target compile options
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
set(CMAKE_VERBOSE_MAKEFILE 1)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_DEFINITIONS "Bits64_;UNIX;_BOOL;LINUX;FUNCPROTO;_GNU_SOURCE;LINUX_64;REQUIRE_IOSTREAM")
set(GCC_COMPILE_OPTIONS "-m64;-fPIC;-fno-strict-aliasing;-Wall;-Wno-multichar;-Wno-comment;-Wno-sign-compare;-funsigned-char;-pthread;-Wno-deprecated;-Wno-reorder;-ftemplate-depth-64;-fno-gnu-keywords;-std=c++0x;-Winline")
set(GCC_COMPILE_DEBUG_OPTIONS "${GCC_COMPILE_OPTIONS};-ggdb;-O0")
@qlibp
qlibp / shortcuts.md
Created June 26, 2023 03:49 — forked from memphys/shortcuts.md
Bash Shortcuts For Maximum Productivity

source: http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/

Command Editing Shortcuts

  • Ctrl + a – go to the start of the command line
  • Ctrl + e – go to the end of the command line
  • Ctrl + k – delete from cursor to the end of the command line
  • Ctrl + u – delete from cursor to the start of the command line
  • Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
  • Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
@qlibp
qlibp / merge.sh
Created May 31, 2023 01:20 — forked from AlexisTM/merge.sh
Merge multiple compile_commands.json
# This is to be used with catkin_make or catkin_tools if we want to merge compile_commands.txt in a single file to allow some tools to work such as Sourcetail.
sudo apt install jq
jq -s 'map(.[])' PATH_TO_COMPILE_COMMANDS_ROOT/**/compile_commands.json > compile_commands.json
@qlibp
qlibp / rayCastConditional.py
Created January 4, 2023 09:03 — forked from Arakade/rayCastConditional.py
Blender Python (bpy) code to iterate raycast until a predicate passes
import bpy
import bmesh
import mathutils
from math import radians, degrees
from mathutils.bvhtree import BVHTree
def rayCastConditional(ray, rayTarget, increment, predicate):
"""Cast multiple rays until 'predicate' passes.
ray: (p, direction)
rayTarget: something with ray_cast() such as:
@qlibp
qlibp / gist:916e7e3f539c46a83c1be8526a25bb56
Created November 26, 2022 13:30 — forked from dotrung/gist:a32aad56ddbb5f218b7c3ec51639b6f0
Install Vim 8 with Python, Python 3 support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install build-essential cmake
sudo apt-get install python-dev python3-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
@qlibp
qlibp / Docker
Created September 23, 2022 00:12 — forked from mitchwongho/Docker
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@qlibp
qlibp / PyCharmIntelliJShared.md
Created August 31, 2022 03:23 — forked from vipulmathur/PyCharmIntelliJShared.md
Run PyCharm and IntelliJ IDEA on the same codebase

Problem

PyCharm and IntelliJ IDEA use the .idea directory to keep project information. While the two seem to be able to read each other's files, they (currently) don't understand the other's settings.

Solution

The work-around (till they learn to play better with each other) is to keep their .idea folders separate, while sharing a common project source tree. Instructions follow below.

@qlibp
qlibp / rospy_logging.py
Created April 21, 2022 12:32 — forked from nzjrs/rospy_logging.py
Reconnect python logging calls with the ROS logging system
class ConnectPythonLoggingToROS(logging.Handler):
MAP = {
logging.DEBUG:rospy.logdebug,
logging.INFO:rospy.loginfo,
logging.WARNING:rospy.logwarn,
logging.ERROR:rospy.logerr,
logging.CRITICAL:rospy.logfatal
}