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
#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 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 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 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
#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 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 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 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
document.dispatchEvent(new Event('mobi.omegacentauri.killStretchVideoEvent')); | |
var vid = document.getElementsByTagName('video'); | |
if (vid.length == 0) { | |
alert("No video elements found in this page."); | |
} | |
else { | |
var mode = prompt("Enter one of these:\n"+ | |
"(a) horizontal,vertical : a pair of scale ratios\n"+ | |
"(b) horizontal:vertical : the correct aspect ratio for a badly encoded video\n", "1,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
var vid = document.getElementsByTagName('video'); | |
if (vid.length == 0) { | |
alert("No video elements found in this page."); | |
} | |
else { | |
var rate = prompt("Enter rate", vid[0].playbackRate); | |
if (rate != null) | |
for(let v of vid) | |
v.playbackRate = rate; | |
} |
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 bookmarklet(linkId, gistRawLink) { | |
fetch(gistRawLink).then(function(response) { | |
if (!response.ok) { | |
//alert("Error fetching "+response.statusText); | |
} | |
else { | |
response.text().then(function(text) { | |
var link = document.getElementById(linkId); | |
link.href = "javascript:"+encodeURIComponent("(function(){"+text+"})()"); | |
}); |
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
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 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
/** | |
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 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
# 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 |
OlderNewer