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
#include <dma_private.h> | |
#define PIN_TO_PULSE PB12 | |
#define DMA_PWM_MAX_DUTY 32 | |
uint32_t data[DMA_PWM_MAX_DUTY]; | |
void setDMAPWM(uint32_t pin, uint32_t duty_cycle) { | |
gpio_dev *dev = digitalPinToPort(pin); | |
uint32_t maskOn = digitalPinToBitMask(pin); |
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
#define BITBAND_SRAM_BASE 0x22000000u | |
#define SRAM_START 0x20000000u | |
#define BITBAND_PERIPHERAL_BASE 0x42000000u | |
#define PERIPHERAL_START 0x40000000u | |
#define BITBAND_SRAM(address, bit) ( *(volatile uint32*)( BITBAND_SRAM_BASE + ((uint32)(address)-SRAM_START) * 32u + (uint32)(bit)*4u) ) | |
#define BITBAND_PERIPHERAL(address, bit) *( (volatile uint32*)( BITBAND_PERIPHERAL_BASE + ((uint32)(address)-PERIPHERAL_START) * 32u + (uint32)(bit)*4u) ) | |
#define GPIO_OFFSET(gpioLetter) (0x400u * (uint32)((gpioLetter)-'A')) | |
#define BITBAND_GPIO_INPUT(gpioLetter, bit) BITBAND_PERIPHERAL((uint32)&(GPIOA_BASE->IDR)+GPIO_OFFSET(gpioLetter), (bit)) | |
#define BITBAND_GPIO_OUTPUT(gpioLetter, bit) BITBAND_PERIPHERAL((uint32)&(GPIOA_BASE->ODR)+GPIO_OFFSET(gpioLetter), (bit)) |
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 PIL | |
import PIL.ImageGrab | |
import os.path | |
import sys | |
import keyboard | |
import ctypes.wintypes | |
from getopt import getopt | |
def makefilename(base): | |
if base.lower().endswith(".png"): |
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
var meta = document.querySelector('meta[name="viewport"]'); | |
if (meta != null) | |
meta.content = 'min-width=10, max-width=10000, min-height=10, max-height=10000, initial-scale=1.0, maximum-scale=50.0, minimum-scale=0.02, user-scalable=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 re | |
import sys | |
dict = {} | |
overrideDict = {} | |
ignore = set() | |
unknown = [] | |
equalRE = re.compile(r'\s*([^<=\s]+)\s*\=\s*(.*)') | |
copyRE = re.compile(r'\s*([^<=\s]+)\s*\<\=\s*(.*)') |
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
# Volume and pause/play in Netflix and Acorn with Philips 642 DVD remote | |
# PageUp/Down with projector remote | |
import win32com.client | |
import win32api, win32con, win32gui | |
from espremote import ESPRemote | |
try: | |
from showtime import showtime | |
except: | |
pass |
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 * | |
from math import * | |
def randomOpen(): | |
while True: | |
r = random() | |
if 0 < r: | |
return r | |
class Grid(object): |
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
/** | |
The MIT License (MIT) | |
Copyright (c) 2015 Don McCurdy | |
Copyright (c) 2018 Alexander Pruss | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |
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 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() |
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
(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); | |
}})(); |
OlderNewer