Skip to content

Instantly share code, notes, and snippets.

View vins31's full-sized avatar

Vincent A. vins31

  • Toulouse, France
View GitHub Profile
# Note 1: change the grep cpp to filter an other extension
# Note 2: only "total lines" is relevant.
IFS=$'\n'; for ppl in $(git log --format='%aN' | sort -u); do echo $ppl; git log --author="$ppl" --pretty=tformat: --numstat | grep cpp | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n",add,subs,loc }'; done
@vins31
vins31 / Python pointers educational
Created July 11, 2014 21:04
A common mistake. Don't fall into the trap!
"""
Educational code snippet for testing pointers familiarity.
Guess the output and find the bad practice.
"""
class Cat:
def __init__(self, s):
self.state = s
def observe(cats):
@vins31
vins31 / opencvni.cpp
Last active July 6, 2021 15:48
Sample to grab depth frames from an Asus Xtion or Occipital Structure depth sensor with OpenNI2 and OpenCV3
/*
* Build command:
* g++ -o opencvni opencvni.cpp `pkg-config --cflags --libs opencv`
*/
#include "opencv2/videoio/videoio.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
--------------------------------------------------------------------------------
CHANGING SYSTEM STATES
--------------------------------------------------------------------------------
systemctl reboot # Reboot the system (reboot.target)
systemctl poweroff # Power off the system (poweroff.target)
systemctl emergency # Put in emergency mode (emergency.target)
systemctl default # Back to default target (multi-user.target