Skip to content

Instantly share code, notes, and snippets.

View RaphaelWimmer's full-sized avatar

Raphael Wimmer RaphaelWimmer

View GitHub Profile
@pklaus
pklaus / arbitrary-waveform-test.py
Created May 4, 2012 19:05
Controlling the Rigol DG1022 with Python on Linux (using the usbtmc driver) – Proof of Concept
#!/usr/bin/env python2
import usbtmc
import time
from math import sin
listOfDevices = usbtmc.getDeviceList()
dn = listOfDevices[0]
d = usbtmc.UsbTmcDriver(dn)
print d.getName()
@sharmaeklavya2
sharmaeklavya2 / create_timetable.py
Last active July 23, 2017 11:11
Script to make timetable in HTML using a list of sections
#/usr/bin/env python
'Generate Time Table'
from __future__ import print_function
import sys
import argparse
from collections import defaultdict
START_TIME = 8
# Time when classes start
@bkaradzic
bkaradzic / orthodoxc++.md
Last active November 18, 2024 07:53
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@chopfitzroy
chopfitzroy / client.sh
Created August 4, 2016 06:26
Synergy multiple servers for one client
#!/bin/bash
# IP address to cycle through (in order of priority)
ip=( "192.168.20.102" "192.168.20.103" )
# Check if synergy is already connected
if pgrep "synergyc"; then
# Synergy already connected
echo "Synergy is already running."
else
@bodil
bodil / fix-my-stupid-folio.service
Created November 24, 2016 15:05
Hacks for Linux kernel glitches on the HP Elitebook Folio G1
[Unit]
Description=HP Elitebook Folio G1 fixes
[Service]
ExecStart=/sbin/fix-my-stupid-folio
[Install]
WantedBy=basic.target
@bhive01
bhive01 / see3cam_test.py
Last active December 17, 2018 16:30
reading images from a see3cam CU40
import math
import numpy as np
import cv2
cam = cv2.VideoCapture(0)
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cam.set(cv2.CAP_PROP_CONVERT_RGB, False) # turn off RGB conversion
# cam.set(cv2.CAP_PROP_FOURCC('Y', '1', '6', ''))
@bhive01
bhive01 / see3cam_good_np_slicing.py
Created April 16, 2018 02:49
CU40 with Numpy Slicing (efficient for video on Raspberry Pi)
# TESTING HARDWARE
# see3CAM_CU40
# raspberry Pi 3 bf8
# Raspbian Stretch 13-03-2018
# Python 3.5.3
# OpenCV 3.4.1
# load required libraries
import math
import numpy as np
@GrantTrebbin
GrantTrebbin / stl-surface.py
Created October 2, 2019 09:15
Generate a 3D model based on a 2D equation
# stl-surface.py
# Generate a 3D model based on a 2D equation
# The model will be rectangular with a flat base. The top surface is based on
# a provided equation in "surface_function". The file name can be set with the
# output_filename variable. The x and y width of the model and the grid spacing
# is defined by the following parameters.
# x_spacing
#!/usr/bin/env python
import math
import sys
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb)
# Assumes x1 < x2, y1 < y2
@dajiaji
dajiaji / python_cwt_sample_eudcc_02.py
Last active November 17, 2021 11:50
A simple EUDCC verifier implementation with Python CWT.
import json
import os
import zlib
import requests
from base45 import b45decode
import cwt
from cwt import load_pem_hcert_dsc