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
using NAudio.Wave; | |
using NAudio.Lame; | |
using YoutubeExplode; | |
using YoutubeExplode.Videos.Streams; | |
namespace YoutubeDownloader | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
// RbacOrgManager (index of orgs, invites for self) | |
// RbacOrg | |
/** | |
* @title RbacOrg | |
* @dev Autonomous organisation with role based access |
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
(* An implementation of algorithm 1 from https://aclanthology.org/J00-1002.pdf *) | |
open Printf | |
module IntSet = Set.Make(Int) | |
module CharSet = Set.Make(Char) | |
module IntMap = Map.Make(Int) | |
module CharMap = Map.Make(Char) | |
module StringSet = Set.Make(String) | |
module StringMap = Map.Make(String) |
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
import { | |
derived, | |
writable, | |
Readable, | |
Unsubscriber, | |
readable, | |
} from "svelte/store"; | |
export function map<A, B>( | |
mapper: (value: A) => B, |
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
async function* seconds() { | |
let i = 0 | |
while (i < 10) { | |
await new Promise(resolve => setTimeout(resolve, 1000)) | |
i++ | |
yield i | |
} | |
} | |
function map(f, gen) { |
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
import { useState, useEffect, Dispatch, SetStateAction } from "react" | |
type SetState<S> = Dispatch<SetStateAction<S>> | |
/* | |
Shares state amongst all instances, without using context API | |
This is a more lightweight redux alternative | |
Note that the initial state is set outside of any mounted instance, | |
as in redux. | |
*/ |
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 fs = require('fs') | |
const readline = require('readline') | |
async function readDict(dictFile, wordLength) { | |
const words = {} | |
return new Promise((resolve) => { |
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 createXylophone() { | |
const context = new (window.AudioContext || window.webkitAudioContext)() | |
const oscillator = context.createOscillator() | |
const gain = context.createGain() | |
oscillator.type = 'sine' | |
oscillator.connect(gain) | |
gain.connect(context.destination) |
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 uuid(): string { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { | |
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8) | |
return v.toString(16) | |
}) | |
} | |
type NumberMap = { [id: string]: number } | |
class PNCounter { |
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
// ---------- Store builder | |
export interface Initial<S> { | |
(): S | |
} | |
export interface Listener<S> { | |
(obj: S, prop?: (keyof S), value?: any): any | |
} |
NewerOlder