Skip to content

Instantly share code, notes, and snippets.

View royshil's full-sized avatar

Roy Shilkrot royshil

View GitHub Profile
@royshil
royshil / NRUBSOpenCV.cpp
Last active October 7, 2019 12:21
Simple 2D NURBS renderer for OpenCV, reading a DXF file.
/*
* Simple 2D NURBS renderer for OpenCV, reading DXF files
*
* The MIT License (MIT)
*
* Copyright (c) 2013 Roy Shilkrot
*
* Updated: Nov 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
@royshil
royshil / GLWidgetOpenGL4Example.cpp
Last active July 17, 2019 01:38
Simple example of OpenGL 4.1 in a QGLWidget
/*
* GLWidgetOpenGL4Example.h
*
* Created on: Apr 23, 2016
* Author: roy_shilkrot
*
*/
class GLWidgetOpenGL4Example : public QGLWidget {
public:
@royshil
royshil / SimpleARQGLViewer.cpp
Created February 16, 2015 19:31
Augmented Reality application with QGLViewer
/*
* SimpleARQGLViewer.cpp
* Creating an AR application with QGLViewer
*
* Created by Roy Shilkrot on 2/16/2015
* Copyright 2015 Roy Shilkrot. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@royshil
royshil / BUILD
Created March 8, 2018 20:51
Scripts for cross-compiling Tensorflow 1.5+ for the Jetson TK1 arm-based SoM
package(default_visibility = ["//visibility:public"])
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi-v7a|compiler": ":cc-compiler-armeabi",
"k8|compiler": ":cc-compiler-local",
},
)
@royshil
royshil / setup.sh
Last active January 27, 2018 14:05
Setup an automatic Tensorflow-CUDA-Docker-Jupyter machine on Google Cloud Platform
#!/bin/bash
# First you must install the 4.4.0 kernel:
# $ sudo apt-get install linux-image-4.4.0-112-generic
# find all the other kernels and remove them:
# $ sudo apt-get purge linux-image-4.13.0-1008-gcp
# $ sudo update-grub
# $ sudo reboot
sudo apt-get update && sudo apt-get install -y \
@royshil
royshil / OGL_OCV_common.cpp
Created February 16, 2015 17:16
OpenCV OpenGL common interop: OpenCV Mat to OpenGL texture, 2D drawing of textures
/*
* OGL_OCV_common.cpp
* Common interop between OpenCV and OpenGL
*
* Created by Roy Shilkrot on 2/16/2015
* Copyright 2015 Roy Shilkrot. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@royshil
royshil / circle_of_deadlines.html
Created June 20, 2017 15:59
A d3v4 visualization of yearly submission deadlines (conference, grant, etc). Tool for the hungry assistant professor.
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.23.1/babel.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/4.6.0/d3.min.js"></script>
<script src="http://unpkg.com/d3-radial-axis@1.5/dist/d3-radial-axis.min.js"></script>
<script src="https://npmcdn.com/d3fc-rebind@4.0.1/build/d3fc-rebind.js"></script>
<script src="https://npmcdn.com/d3fc-data-join@2.0.0/build/d3fc-data-join.js"></script>
<script src="https://npmcdn.com/d3fc-label-layout@4.0.0/build/d3fc-label-layout.js"></script>
@royshil
royshil / LoadingSpinner.java
Last active February 20, 2016 16:45
A Tapestry 5 Mixin for a loading spinner with spin.js
package com.yourapp.mixins;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ClientElement;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.InjectContainer;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
@royshil
royshil / custom-width-sidebar.html
Created January 27, 2016 12:07
Custom width sidebar with Bootstrap3 container-fluid main
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
@royshil
royshil / main.cpp
Created December 12, 2013 23:37
Simple HID "driver" for the AIPTEK HyperPen model T-6000U using libHID
/*
* Simple HID "driver" for the AIPTEK HyperPen model T-6000U using libHID
* http://bfoz.github.io/libhid/
*
* The MIT License (MIT)
*
* Copyright (c) 2013 Roy Shilkrot
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal