Skip to content

Instantly share code, notes, and snippets.

@rubenhorn
rubenhorn / fast_object_localization.py
Created April 12, 2020 22:10
Fast (30fps on CPU) object localization using pretrained model from TensorFlow Hub
#!/usr/bin/env python3
import cv2
import tensorflow as tf
import tensorflow_hub as hub
import time
module_handle = 'https://tfhub.dev/google/object_detection/mobile_object_localizer_v1/1'
print('loading object detection model...')
{
"name": "latex-workshop",
"displayName": "LaTeX Workshop",
"description": "Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.",
"icon": "icons/icon.png",
"version": "8.7.1",
"publisher": "James-Yu",
"license": "MIT",
"homepage": "https://github.com/James-Yu/LaTeX-Workshop",
"repository": {
@rubenhorn
rubenhorn / code.gs
Created November 26, 2019 21:28
Google App Script for logging temperature values in Google Sheet file
// From https://github.com/varul29/SHT25_GoogleSheets_GoogleScript?source=post_page-----27912740e74a----------------------
var filename = 'temp_log_sheet';
var sheetName = 'values';
var columns = ['time', 'celsius', 'location'];
function getSheet() {
var files = DriveApp.getFilesByName(filename);
var file;
var didCreateFile = false;
@rubenhorn
rubenhorn / EnergySource.cs
Last active October 29, 2019 17:41
A Unity3d script emulating a power network
using System.Collections.Generic;
using UnityEngine;
public class EnergySource : MonoBehaviour
{
public float maxEdgeLength = 1.0f;
public string vertexTag = "GraphVertex";
private TransformGraph<GameObject> graph = new TransformGraph<GameObject>();
@rubenhorn
rubenhorn / YTranslate.cs
Created October 16, 2019 09:08
Unity script for machine translation using the Yandex Translate API
using System.Collections;
using System;
using System.Xml;
using UnityEngine.Networking;
/*
Requirement:
Yandex Translate API key (https://tech.yandex.com/translate/)
Usage:
@rubenhorn
rubenhorn / RedirectAppOutputStream.java
Last active March 21, 2020 15:05
Redirect the output of System.out.println() to a Swing gui
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class RedirectAppOutputStream {