Skip to content

Instantly share code, notes, and snippets.

@nivir
nivir / sublime-clean
Created July 24, 2020 10:47 — forked from gerardroche/sublime-clean
Clean Sublime Text caches and optionally clean out any sessions
# 301 https://github.com/gerardroche/dotfiles
@nivir
nivir / Munene.py
Created July 6, 2020 20:45 — forked from PierraKimathi-zz/Munene.py
Munene Word Search
"""
Munene is extremely disappointed to find out that no one in the office knows his first name. Even his close mates call him only by his last name. Frustrated, he decides to make his fellow workmates know his first name by forcing them to solve this question.
You are given a long string as input in each testcase, containing any ASCII character. Your task is to find out the number of times SUVO and SUVOJIT appears in it.
Note: This problem CAN BE SOLVED IN Java, Python or PHP.
Input Format
The first line contains the number of testcases, T. Next, T lines follow each containing a long string S.
Output Format
For each long string S, display the no. of times SUVO and SUVOJIT appears in it."""
@nivir
nivir / update_git_repos.sh
Created June 29, 2020 00:05 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@nivir
nivir / combinations.py
Created July 14, 2018 23:39 — forked from dougwt/combinations.py
Python: All Possible Combinations
def combinations(n, list, combos=[]):
# initialize combos during the first pass through
if combos is None:
combos = []
if len(list) == n:
# when list has been dwindeled down to size n
# check to see if the combo has already been found
# if not, add it to our list
if combos.count(list) == 0:
@nivir
nivir / CMakeLists.txt
Created June 27, 2018 17:58 — forked from UnaNancyOwen/CMakeLists.txt
Drawing Point Cloud retrieve from Velodyne VLP-16
cmake_minimum_required( VERSION 2.8 )
# Create Project
project( solution )
add_executable( project main.cpp )
# Set StartUp Project (Option)
# (This setting is able to enable by using CMake 3.6.0 RC1 or later.)
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
@nivir
nivir / git-change-commit-messages.md
Created January 1, 2018 22:53 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

#!/usr/bin/python
import rosbag
import sys
inbag_name = sys.argv[1]
outbag_name = inbag_name.replace('.bag', '-fixed.bag')
with rosbag.Bag(outbag_name, 'w') as outbag:
for topic, msg, t in rosbag.Bag(inbag_name).read_messages():
if topic == "/camera/depth_registered/points_drop" and msg.header.frame_id:
@nivir
nivir / kitti_lidar.py
Created November 2, 2017 19:05 — forked from ronrest/kitti_lidar.py
Visualize Lidar Data in Kitti Data
"""
VISUALISE THE LIDAR DATA FROM THE KITTI DATASET
Based on the sample code from
https://github.com/utiasSTARS/pykitti/blob/master/demos/demo_raw.py
And:
http://stackoverflow.com/a/37863912
Contains two methods of visualizing lidar data interactively.
- Matplotlib - very slow, and likely to crash, so only 1 out of every 100
@nivir
nivir / Question
Created May 7, 2017 22:13 — forked from r-julien-bataille/Question
Movie rating
using System;
using System.Collections.Generic;
namespace MyCollections
{
public class Movie {
private readonly int movieId;
private readonly float rating;
private List<Movie> similarMovies; // Similarity is bidirectional