Skip to content

Instantly share code, notes, and snippets.

Avatar

Dov Grobgeld dov

  • Rehovot, Israel
View GitHub Profile
@dov
dov / WifiServerACD1mini.ino
Created Jul 22, 2020
A web server for sending raw IR codes
View WifiServerACD1mini.ino
// This is as a web server library used for sending raw IR codes
// to an IR-Led.
//
// The raw string decoding code was borrowed from:
//
// https://github.com/crankyoldgit/IRremoteESP8266
//
//
// License: GLPL v2.1
//
View npcat
#!/usr/bin/python
# Cat a np array from a .npy file
import numpy as np
from PIL import Image
import sys
def die(msg):
msg += "\n" if msg[-1]!="\n" else ""
sys.stderr.write(msg)
@dov
dov / pybind11.md
Last active Oct 8, 2019
pybind11 shadow classes for C++ objects
View pybind11.md

Intro

Have you ever wondered how to create XJet like python bindings to your own C++ classes, with a modern python binding package? Wonder no longer!

// Example to allocate a class in C++, wrap it as a python class and call a
// member of it from python.
//
// 2019-10-08 Tue

#include <stdio.h>
@dov
dov / my-py-jump-exception.el
Created May 15, 2018
Elisp function to jump to the python exception line pointed at
View my-py-jump-exception.el
(defun py-jump-exception-line ()
"This function parses the python exception stack and jumps to the line pointed at"
(interactive)
(save-selected-window
(let ((file nil)
(line nil)
(buffer (current-buffer)))
(beginning-of-line)
(forward-word)
(forward-char)
@dov
dov / decrypt-en.py
Created May 16, 2017
Decrypting Epsilon Note encoded notes with python (given the password)
View decrypt-en.py
#!/usr/bin/python
######################################################################
# Decrypt an Epsilon Note encoded file given the password.
#
# This file is in the public domain.
#
# Dov Grobgeld <dov.grobgeld@gmail.com>
# 2017-02-17 Fri
######################################################################
@dov
dov / GestureParse.py
Created Jan 8, 2017
A parser of the Android Gesture file format that outputs giv files for each character
View GestureParse.py
#!/usr/bin/python
######################################################################
# A python parser for the file format in the Android Gesture builder.
# Each character is output in a giv (http://giv.sourceforge.net/giv/)
# file format.
#
# MIT License
#
# Copyright (c) 2017 Dov Grobgeld
@dov
dov / pandassrt.py
Last active Jan 8, 2017
Realign srt files
View pandassrt.py
# This file reads two subtitle srt files. The first one is assumed
# to be wrongly aligned, and the second one is correctly aligned.
# In additon the user needs to create a few alignment points. These
# will be used for rescaling the timescale of the first srt file
# so that it fits the second file.
#
# Dov Grobgeld
# dov.grobgeld@gmail.com
import pandas as pd
View VtkPickPieces.py
#!/usr/bin/python
# This example creates a board with a flat surface at z=0
# and a number of pieces that may interactively be moved
# around the board by the mouse.
#
# Dov Grobgeld <dov.grobgeld@gmail.com>
# This example is released under the same BSD licence as vtk.
import vtk