This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
(function(){ | |
var url = window.location.href; | |
var m = url.match("/(dp|gp/product)/([^/]+)"); | |
var pid = undefined; | |
if(m) { | |
var pid = m[2]; | |
var s = url.match("[^:]*://[^/]+")[0]; | |
window.open(s+"/gp/offer-listing/"+pid); | |
}})(); |
This file contains hidden or 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 hidden or 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 evdev | |
from select import select | |
from sys import argv, exit | |
from os import system | |
TRIGGER_KEY = evdev.ecodes.KEY_W | |
TRIGGER_MODIFIER_DISJUNCTIVE = set((evdev.ecodes.KEY_LEFTCTRL, evdev.ecodes.KEY_RIGHTCTRL)) | |
keysDown = set() |