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 * as dnssd from 'npm:ya-dns-sd' | |
const timeout = Number(Deno.args[0]) || 30 | |
// Check if it's needed and prompt | |
const connectedDevices = new TextDecoder().decode(await Deno.run({ | |
cmd: ['adb', 'devices'], | |
stdout: 'piped' | |
}).output()).split(/\r?\n/g).filter(e => e).slice(1).map(e => e.split('\t')[0]) |
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 { parseFlags } from 'https://deno.land/x/[email protected]/flags/mod.ts' | |
import parse from 'https://cdn.skypack.dev/pin/@qgustavor/[email protected]/mode=imports/optimized/@qgustavor/ass-parser.js' | |
import stringify from 'https://cdn.skypack.dev/pin/@qgustavor/[email protected]/mode=imports/optimized/@qgustavor/ass-stringify.js' | |
import JSON5 from 'https://deno.land/x/[email protected]/mod.ts' | |
const defaultConfig = { | |
targetDir: '..', | |
filenameReplacement: null, | |
handleLineBreaks: false, | |
shiftTimes: false, |
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
const functions = [ | |
(e, target, source) => Math.round(e * target / source), | |
(e, target, source) => Math.floor(e * target / source), | |
(e, target, source) => Math.ceil(e * target / source), | |
(e, target, source) => 1 + Math.round((e - 1) * target / source), | |
(e, target, source) => 1 + Math.floor((e - 1) * target / source), | |
(e, target, source) => 1 + Math.ceil((e - 1) * target / source), | |
(e, target, source) => Math.round((e - 1) * target / source), | |
(e, target, source) => Math.floor((e - 1) * target / source), | |
(e, target, source) => Math.ceil((e - 1) * target / source), |
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
export async function* recursiveReadDir (url) { | |
for await (const dirEntry of Deno.readDir(url)) { | |
if (dirEntry.isDirectory) { | |
yield * recursiveReadDir(new URL(dirEntry.name, url.href + '/')) | |
} else if (dirEntry.isFile) { | |
yield new URL(dirEntry.name, url.href + '/') | |
} | |
} | |
} |
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 FFT from 'https://raw.githubusercontent.com/qgustavor/stream-audio-fingerprint/master/src/lib/fft.ts' | |
let device = Deno.args[0] | |
if (!device) { | |
const devicesProcess = await Deno.run({ | |
cmd: ['ffmpeg', '-list_devices', 'true', '-f', 'dshow', '-i', 'dummy'], | |
stderr: 'piped' | |
}) | |
const devicesOutput = new TextDecoder().decode(await devicesProcess.stderrOutput()) | |
const devices = Array.from(devicesOutput.matchAll(/\[dshow.* "(.*)" \(audio\)/g)).map(e => e[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
// Download Deno here: https://deno.land/#installation | |
// Download this file | |
// Run it using: deno run -A adb-auto-connect.ts [ip address] | |
import PQueue from 'https://deno.land/x/[email protected]/mod.ts' | |
import ProgressBar from 'https://deno.land/x/[email protected]/mod.ts' | |
const hostname = Deno.args[0] ?? '' // <-- set default ip address here to make the argument optional | |
// Check if it's needed and prompt |
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
/* ==UserStyle== | |
@name DuckDuckGo From Hologra Episode 139 | |
@namespace thesola10 | |
@version 1.0.0 | |
@license MIT | |
@updateURL https://gist.github.com/qgustavor/f46d933d45dac29b6894f8c60d0d1e9d/raw/duckduckgo.user.css | |
@author thesola10, qgustavor | |
==/UserStyle== */ | |
@-moz-document domain("duckduckgo.com") { |
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
// Run in console in a page with sha256 loaded as a global | |
(async function () { | |
let durations = [] | |
for (let i = 0; i < 100; i++) { | |
const times = 5000 | |
const value = '' | |
const start = Date.now() | |
let hashHex = value | |
for (let i = 0; i < times; i++) { | |
const hashBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(hashHex).buffer) |