Skip to content

Instantly share code, notes, and snippets.

View rubdos's full-sized avatar
💬

Ruben De Smet rubdos

💬
View GitHub Profile
@rubdos
rubdos / fgfs test code
Created April 19, 2013 20:05
Code used with flightgear
//PIN 0 -> 7 has positive segment part
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
#!/usr/bin/python3
import sqlite3
conn = sqlite3.connect("trackerbackup")
c = conn.cursor()
vcard = open("contacts.vcard","w+")
PersonContacts = []
#!/bin/python2
from Tkinter import *
import tkFileDialog
import base64
import tempfile
import os
import sys, subprocess
class App:
@rubdos
rubdos / motiondetect.py
Created August 27, 2014 12:00
Simple pythonscript to detect motion using a webcam
#!/bin/python
import numpy as np
import cv2
def diffImg(i0,i1,i2):
d1 = cv2.absdiff(i2, i1)
d2 = cv2.absdiff(i1, i0)
return cv2.bitwise_and(d1, d2)
cap = cv2.VideoCapture(0)
@rubdos
rubdos / compile_procedures.py
Created January 5, 2015 15:45
compile_procedures.py
#!/usr/bin/python
# Please put this file in the $FG_ROOT directory, chmod +x and run, then look in the procedures subdirectory.
import xml.etree.ElementTree as etree
import os
import shutil
from subprocess import call
def generate_procedures(source):
@rubdos
rubdos / pingpongballtwitter
Created March 18, 2015 12:06
Ping pong ball controller Twitter coupling
#!/usr/bin/env python
import tweepy, time, sys, serial, json
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_KEY = ''
ACCESS_SECRET = ''
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
@rubdos
rubdos / hello.sh
Created July 16, 2015 12:01
hello-world mesos
while [ true ] ; do echo 'Hello Marathon' ; sleep 5 ; done
@rubdos
rubdos / stylish.css
Created September 19, 2015 19:55
Use Hack font for github through Stylish
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("github.com") {
@font-face { font-family: 'Consolas'; src: local('Hack'); }
.blob-code-inner, tt, code, pre,
.ace_editor.ace-github-light {
font-family: "Hack" !important;
}
}
#!/usr/bin/env python3
from boodschap.database import Product, productdb
from datetime import timedelta, datetime
from multiprocessing.pool import ThreadPool
import time
import urllib
import json
import threading
from queue import Queue
ncalls tottime percall cumtime percall filename:lineno(function)
39 0.000 0.000 0.000 0.000 genericpath.py:111(_splitext)
39 0.000 0.000 0.001 0.000 genericpath.py:16(exists)
39 0.000 0.000 0.000 0.000 path.py:131(clean_name)
39 0.000 0.000 0.000 0.000 path.py:144(maketrans_init)
1 0.000 0.000 0.000 0.000 path.py:174(<dictcomp>)
40 0.000 0.000 0.000 0.000 path.py:57(abspath)
39 0.000 0.000 0.000 0.000 posixpath.py:115(splitext)
39 0.000 0.000 0.000 0.000 posixpath.py:136(basename)
1 0.000 0.000 0.000 0.000 posixpath.py:158(islink)