Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Fix WontFix

guest271314

💭
Fix WontFix
View GitHub Profile
@lukaslihotzki
lukaslihotzki / polyfill_worklet_import.js
Last active Oct 1, 2022
Polyfill to support "import" in worklet scripts in Firefox
View polyfill_worklet_import.js
const wrappedFunc = Worklet.prototype.addModule;
Worklet.prototype.addModule = async function(url) {
try {
return await wrappedFunc.call(this, url);
} catch (e) {
if (e.name != 'AbortError') {
throw e;
}
// assume error is caused by https://bugzilla.mozilla.org/show_bug.cgi?id=1572644
@zed
zed / ping_pong.c
Last active Oct 16, 2022
Native messaging "ping_pong" example in C
View ping_pong.c
/*** Native messaging "ping_pong" example in C.
*
* It is reimplementation of the corresponding Python example from
* https://github.com/mdn/webextensions-examples/tree/master/native-messaging
*
* # Python 3.x version
* # Read a message from stdin and decode it.
* def getMessage():
* rawLength = sys.stdin.buffer.read(4)
* if len(rawLength) == 0:
@littledan
littledan / anonymous-inline-modules.md
Last active Jun 29, 2022
Anonymous inline modules
View anonymous-inline-modules.md

Note: this document is subsumed by the module blocks proposal

Anonymous inline modules

Anonymous inline modules are syntax for the contents of a module, which can then be imported.

let inlineModule = module {
  export let y = 1;
};
@UCIS
UCIS / gist:845eda1755d38eddfc3f0f99268c27da
Created Jun 17, 2020
Opus/WebM player in JavaScript
View gist:845eda1755d38eddfc3f0f99268c27da
function OpusWebmPacker() {
var channels = 2;
var sample_rate = 48000;
var position = 0;
var packets = [];
var buffer = new Uint8Array(4 + 1275);
var buffer_offset = 0;
function Concat() {
View gist:983f2c16d36aee7f75cff4ac477d6805
class WebmPacketizer : IPacketizer {
private UInt64 position = 0;
static WebmPacketizer () {
}
public WebmPacketizer() {
}
private static Byte[] Concat(params Byte[][] parts) {
View gist:c52757fef62239d502806f53b6700a58
class OggPacketizer : IPacketizer {
static UInt32[] checksumTable;
static UInt32 serial_counter = 1;
uint pageIndex = 0;
uint serial;
UInt64 position = 0;
static OggPacketizer() {
initChecksumTable();
}
@TotallyNotChase
TotallyNotChase / host.json
Last active Oct 24, 2022
Native Messaging - Rust
View host.json
{
"name": "pingpong",
"description": "Native messaging host example",
"path": "path/to/release_executable",
"type": "stdio",
"allowed_origins": [
"chrome-extension://extension_id/"
]
}
@TotallyNotChase
TotallyNotChase / host.json
Last active Oct 24, 2022
Native Messaging - C
View host.json
{
"name": "pingpong",
"description": "Native messaging host example",
"path": "path/to/release_executable",
"type": "stdio",
"allowed_origins": [
"chrome-extension://extension_id/"
]
}
@varqox
varqox / recording_application_and_microphone.md
Last active Nov 26, 2022
How to record multiple applications and microphone into one audio file on Linux using PulseAudio
View recording_application_and_microphone.md

How to record multiple applications and microphone into one audio file on Linux

Step 0. Terminology

Sinks are for output, sources are for input. To stream source to sink a loopback must be created. More shall you find there.

Step 1. Create output sink that will be recorded

Our output sink will be named recording.

pacmd load-module module-null-sink sink_name=recording sink_properties=device.description=recording
@Dobby233Liu
Dobby233Liu / a.js
Last active Oct 23, 2022
my messing w/ msedge dev read aloud. ONLY RUN IN edge dev. i give up, so it wont work properly
View a.js
var ARRAY_LENGTH = 16;
var MIN_HEX_LENGTH = 2;
class UUID {
static createUUID() {
const array = new Uint8Array(ARRAY_LENGTH);
window.crypto.getRandomValues(array);
let uuid = '';