- chrome://dino
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 mainLoop = require('main-loop') | |
var h = require('virtual-dom/h') | |
var state = { items: [] } | |
function renderItem (item) { | |
var listItem = h('li.item', { | |
key: item.color, // TODO: use a unique key. | |
style: { 'background-color': item.color }, | |
onclick: function (ev) { removeItem(item.color) } |
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 onHold = require('on-hold') | |
var i = 0 | |
var div = document.createElement('div') | |
var btn = document.createElement('button') | |
btn.textContent = 'Press and Hold' | |
document.body.appendChild(btn) | |
document.body.appendChild(div) |
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
local utils = require 'mp.utils' | |
function load_sub_fn() | |
log("info", "Searching for subtitles") | |
local t = {args = {"subliminal", "download", "-s", "-l", "en", mp.get_property("path")}} | |
local res = utils.subprocess(t) | |
if res.status == 0 and res.stdout:find("0 error") then | |
mp.commandv("rescan_external_files", "reselect") |
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
# Generate lookup table for converting between perceived LED brightness and PWM | |
# Adapted from: https://jared.geek.nz/2013/feb/linear-led-pwm | |
# See also: https://ledshield.wordpress.com/2012/11/13/led-brightness-to-your-eye-gamma-correction-no/ | |
from sys import stdout | |
TABLE_SIZE = 256 # Number of steps (brightness) | |
RESOLUTION = 2**10 # PWM resolution (10-bit = 1024) |