Skip to content

Instantly share code, notes, and snippets.

@show0k
show0k / boards_benchmark.ipynb
Last active March 31, 2016 11:37
Sysbench on Odroid U3 Odroid XU4 Raspberry Pi2 Raspberry Pi3 and i7-5557U laptop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@show0k
show0k / incremental_backup_maya.py
Last active October 5, 2016 22:06
Custom incremental backup for maya. It creates an OLD directory and copy the working file in this directory and increment it version number.
import os
import re
import glob
from shutil import copyfile
import maya.cmds as cmds
BACKUP_NAME = "OLD"
full_filename_uri = cmds.file(save=True, type='mayaAscii')
filename = os.path.basename(full_filename_uri)
@show0k
show0k / README.md
Last active November 20, 2016 17:49
Fix DXF issues on onshape export

Assorted tools needed when dealing with e.g. Onshape DXF exports.

Example usage to batch fix all .dxf files in a directory:

cd directory_with_dxf_files pip install ezdxf mkdir output for f in ls *.dxf; do python convert_onshape_dxf.py -i $f -o output/$f; done;

Keybase proof

I hereby claim:

  • I am show0k on github.
  • I am show0k (https://keybase.io/show0k) on keybase.
  • I have a public key whose fingerprint is 5A51 FBBE 3899 7365 FB61 9CEA 11D8 14ED 7FC4 DB01

To claim this, I am signing this object:

@show0k
show0k / # opencv3 - 2017-03-09_17-35-42.txt
Created March 9, 2017 17:22
opencv3 (homebrew/science/opencv3) on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for homebrew/science/opencv3 on macOS 10.11.6
Build date: 2017-03-09 17:35:42
/* This example shows how to use continuous mode to take
range measurements with the VL53L0X. It is based on
vl53l0x_ContinuousRanging_Example.c from the VL53L0X API.
The range readings are in units of mm. */
//
#include <Wire.h>
#include <VL53L0X.h>
#include <ArduinoJson.h>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@show0k
show0k / delete_github_repositories.bash
Last active October 25, 2017 13:24
Delete Old GitHub repositories
#!/bin/bash
# Create a file repo_list.twt with repositories you want to delete separated by a new line like
# usename/repo1
# username/repo2
FILE=repo_list.txt
# Replace xxx by your token with delete right on https://github.com/settings/tokens
while read r; do
@show0k
show0k / malmo_install_linux.sh
Last active March 16, 2018 15:10
Standalone malmo install on Linux thanks to Ananconda.
# Download and install Miniconda
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
rm miniconda.sh
echo "export PATH=$HOME/miniconda/bin:$PATH" >> "$HOME/.bashrc"
export PATH="$HOME/miniconda/bin:$PATH"
conda config --add channels conda-forge
from __future__ import division
import time
import json
import cv2
from pypot.primitive import LoopPrimitive
import numpy as np
class ColorDetection(LoopPrimitive):
def __init__(self, robot, freq=5.):