Skip to content

Instantly share code, notes, and snippets.

View yonidavidson's full-sized avatar
🐕
Dog Driven Developer

Yoni Davidson yonidavidson

🐕
Dog Driven Developer
View GitHub Profile
@yonidavidson
yonidavidson / nodejs-code-style.md
Last active January 14, 2018 06:20
Comparing nodejs code styles:
@yonidavidson
yonidavidson / hdf5_read.py
Created September 11, 2017 20:25
Reading from hdf5 in batches
batchsize = 1
for i in xrange(0, 500, batchsize):
indexs = train_idx[i:i+batchsize]
print indexs
print "***"
print map(lambda x: X[x], indexs)
print "XXX"
print map(lambda x: Y[x], indexs)
print "YYY"
https://github.com/ryanmcdermott/clean-code-javascript?utm_source=javascriptweekly&utm_medium=email
@yonidavidson
yonidavidson / docker-compose.gui.yml
Last active August 10, 2020 08:52
Set a basic container to run gui applications inside
gui_container:
image: ubuntu:14.04
volumes:
- $HOME/.Xauthority:/root/.Xauthority
environment:
DISPLAY: $DISPLAY
net: "host"
@yonidavidson
yonidavidson / gist:0663f230dcbf7da7cda4
Created July 9, 2015 20:57
Run GUI apps in docker container . host=ubuntu14.04
docker run -it --rm -e DISPLAY -v $HOME/.Xauthority:/root/.Xauthority --net=host ubuntu:14.04 /bin/bash
#add this to ~/.bashrc
##source ~/.git-prompt.sh
##export PS1="$PS1\[\033[01;32m\]\$(__git_ps1)\[\033[00m\]\$ "
#save the attached file to ~/.git-prompt.sh .
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <opencv2/core/core.hpp>