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 mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
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
#!/bin/bash | |
# Check if running with sudo | |
if [ "$EUID" -ne 0 ]; then | |
echo "Please run with sudo:" | |
echo "sudo $0" | |
exit | |
fi | |
# Enable PWM |
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
const createElementDelegate = (ele, config) => { | |
const old2NewMap = new WeakMap(), new2OldMap = new WeakMap(); | |
const clone = (ele, {cloneParent, syncProps, delegateEvents=true, delayedElementListChange}={}) => { | |
if(ele == null) return ele; | |
// clone, and delegate events, and preserve parent classes | |
let cloned = ele.cloneNode(); | |
old2NewMap.set(ele, cloned); | |
new2OldMap.set(cloned, ele); | |
// clone child also |
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 FloatingWindow { | |
static instanceCount = 0; | |
constructor() { | |
let body = document.body; | |
this.containerDiv = document.createElement('div'); | |
this.containerDiv.setAttribute('style', | |
`bottom: ${10 + 110 * FloatingWindow.instanceCount}px;` | |
); |
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 findPaths(obj, kwd, maxDepth = 1, exclude=[]) { | |
const paths = []; | |
function exploreObject(obj, path, depth) { | |
if (depth > maxDepth) { | |
return; | |
} | |
for (const key in obj) { | |
const value = obj[key]; |
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
const apiMap = {} | |
function make_proxy(obj, path = '') { | |
if (typeof obj === "object" || typeof obj === "function") | |
return new Proxy(obj, { | |
get(target, prop) { | |
if (prop === '_origin_') return obj._origin_ ?? obj; | |
const fullPath = path ? `${path}.${String(prop)}` : String(prop); |
This file has been truncated, but you can view the full file.
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
// extracted from ncm 2.10.8, with lots of betterncm plugins installed | |
.playbackrate-settings { right: 140px !important; }.playbackrate-settings-popup { position: fixed; transition: opacity 0.2s ease 0s, transform 0.2s ease 0s; opacity: 0; padding: 15px; border-radius: 10px; background-color: rgba(0, 0, 0, 0.204); backdrop-filter: blur(10px); transform: translateY(10px); z-index: 99999; color: white; }.playbackrate-settings-popup * { color: white; }.pbr-slider-wrapper { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 20px; position: relative; padding-bottom: 4px; overflow: hidden; transition: all 0.3s ease 0s; }.pbr-slider-label { margin-bottom: 12px; }.pbr-slider { appearance: none; background-color: rgba(223, 225, 228, 0.133); border-radius: 20px; width: 100%; height: 8px; }.pbr-slider:first-child { margin-top: 5px; }.pbr-slider::-webkit-slider-thumb { appearance: none; width: 10px; height: 10px; background: rgb(255, 255, 255); cursor: pointer; border-radius: 10px; transition |
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 selectAnyElement() { | |
return new Promise((resolve, reject) => { | |
if(document.querySelector('.tinyNCM-Selected')){ | |
reject("Already selecting"); | |
return; | |
} | |
// create fixed tips | |
let tips = dom("div", | |
{ | |
style: { |
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
pm2 start server.ts --interpreter="node" --node-args="-r esbuild-register" |
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
<body onload="a=30;setInterval(()=>{t.innerText=`aa${(a--)||location.reload()}`},1000)"><c style="text-align: center;"><h1>xxxx</h1><h3 id=t><h3>WGzeyu |
NewerOlder