Skip to content

Instantly share code, notes, and snippets.

@nivir
nivir / .bash_profile
Created July 30, 2016 10:48 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@nivir
nivir / git-blame-club.txt
Created September 18, 2016 20:24 — forked from ldodds/git-blame-club.txt
Git Blame Club
Welcome to Git Blame Club.
The first rule of Git Blame Club is: you do not blame other people.
The second rule of Git Blame Club is: you DO NOT blame other people!
Third rule of Fight Club: if someone yells "CONFLICT!", goes limp, or taps out, the blaming is over.
Fourth rule: only two branches to a merge.
Fifth rule: one merge at a time, everyone.
Sixth rule: the merges are command-line. No editors, no GUIs.
Seventh rule: merges will go on as long as they have to.
And the eighth and final rule: if this is your first day at Git Blame Club, you have to commit.
@nivir
nivir / gist:100829b8625999143d5c5705cc6dc250
Created November 2, 2016 15:11 — forked from ptigas/gist:2820165
linked list implementation in python
class Node :
def __init__( self, data ) :
self.data = data
self.next = None
self.prev = None
class LinkedList :
def __init__( self ) :
self.head = None
@nivir
nivir / gist:8a145cbba72b921810e08a9f3a527495
Created November 2, 2016 15:44 — forked from ptigas/gist:1444735
MapReduce example in python
'''
Playing with MapReduce in python
ref.
http://mikecvet.wordpress.com/2010/07/02/parallel-mapreduce-in-python/
'''
from multiprocessing import Pool
def generate_data(A = 90000, B = 20) :
return [ [ [j] for j in range(B)] for i in range(A)]
@nivir
nivir / latex_escape.py
Created November 2, 2016 15:45 — forked from ptigas/latex_escape.py
latex escape
# -*- encoding: utf-8 -*-
def latex_decode( s ) :
'''
A simple function which taks a latex escaping command
and returns the appropriate unicode character according
to this table (via wikipedia):
LaTeX command Sample Description
\`{o} ò grave accent
@nivir
nivir / hack.summit.2014.markdown
Created February 25, 2017 15:08 — forked from jaysoo/hack.summit.2014.markdown
Hack summit talks

Videos from hack.summit() 2014.

Day 1

Ed Roman - hack.summit() Opening remarks

Scott Hanselman - Author of multiple books on programming, podcaster, educator to half a million developers — Scaling Yourself

Floyd Marinescu - CEO, InfoQ — Culture and Happiness in Virtual Teams

@nivir
nivir / LSA.py
Created March 7, 2017 03:36 — forked from vgoklani/LSA.py
Latent Semantic Analysis (LSA) [simple example]
#!/usr/bin/python
# reference => http://www.puffinwarellc.com/index.php/news-and-articles/articles/33.html
from numpy import zeros
from scipy.linalg import svd
from math import log # needed for TFIDF
from numpy import asarray, sum
titles = ["The Neatest Little Guide to Stock Market Investing",
@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
@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
#!/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: