This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
import win32gui, win32con, win32api, win32file, win32event, win32gui_struct, winnt | |
import threading | |
from pywinusb import hid | |
RIGHT_CLICK = 1<<(5-1) | |
LEFT_CLICK = 1<<(6-1) | |
ACTIVE = 1<<(11-1) | |
UP = 1<<(23-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
# | |
# MIT Licensed code by Alexander R Pruss | |
# | |
# Implements Black's Procedure: Condorcet backed up with Borda to generate a ranked list from ranked votes | |
# and Nanson's Method: drop all candidates with Borda scores below average | |
# | |
# require n [default: None] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import cec | |
from time import sleep, time | |
from evdev import UInput, ecodes | |
import os | |
import sys | |
from threading import Thread | |
DEBUG = False | |
logfile = sys.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import * | |
pa = 0.25 | |
pb = 0.25 | |
def E(f): | |
fa,fb = f | |
return fa + (fb-fa) * pb if fa < fb else fb + (fa-fb) * pa | |
def r(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# public domain | |
import pygame | |
from random import randint | |
width = 400 | |
height = 400 | |
screen = pygame.display.set_mode((width, height)) | |
color = (255,255,255) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# http://programarcadegames.com/python_examples/show_file.php?file=pong.py | |
# | |
import math | |
import pygame | |
import random | |
from ctypes import windll, Structure, c_long, byref | |
user32 = windll.user32 | |
screensize = user32.GetSystemMetrics(78), user32.GetSystemMetrics(79) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Multi BLE Sensor - Richard Hedderly 2019 | |
Based on heart sensor code by Andreas Spiess which was based on a Neil | |
Kolban example. | |
Based on Neil Kolban example for IDF: | |
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleServer.cpp | |
Ported to Arduino ESP32 by Evandro Copercini | |
updates by chegewara |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScratchGamepad { | |
constructor(runtime) { | |
this.id = null | |
this.runtime = runtime | |
this.currentMSecs = -1 | |
this.previousButtons = [] | |
this.currentButtons = [] | |
} | |
getInfo() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# based on : www.daniweb.com/code/snippet263775.html | |
import math | |
import wave | |
import struct | |
# Audio will contain a long list of samples (i.e. floating point numbers describing the | |
# waveform). If you were working with a very long sound you'd want to stream this to | |
# disk instead of buffering it all in memory list this. But most sounds will fit in | |
# memory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIA 0 | |
TIY 0 | |
zeroLoop: | |
AM | |
AIY 1 | |
CIY F | |
JUMP zeroLoop | |
mainLoop: | |
TIA 1 | |
TIY -1 |