View fswatch_untrack.mjs
const fs = require('fs');
const process = require('process');
const child_process = require('child_process');
const filename = 'test.mjs'
const x = fs.watch(filename, (t, f) => {
console.log(`eventType: ${t}, file: ${f}`)
try {
View rollup_bug.md

rollup/#1828

Vim/neovim moves a file before saving, and write its content into an another file. Then, move it to original path. rollup uses fs.watch() for watching events such as changes and renames of a file. When fs.watch() notice an event, immediately rollup try to open a file by using fs.readFileSync(). Due to this behavior, fs.readFileSync() can't find a file when vim/neovim is used for editing it.

Source code:

View vim.js
const fs = require('fs');
const process = require('process');
const child_process = require('child_process');
const sleep = async ms => new Promise(resolve => setTimeout(resolve, ms));
const file = 'vim.js';
let x = fs.watch(file, (async function fn (t, f) {
console.log(`eventType: ${t}, file: ${f}`)
View test.js
const fs = require('fs');
const process = require('process');
const child_process = require('child_process');
/* watch current directory */
const x = fs.watch('.', (t, f) => {
console.log(`eventType: ${t}, file: ${f}`)
try {
console.log(child_process.execSync(`ls -lah test.js`, { encoding: 'utf-8' }))
View youtubeNotify.js
class Message {
constructor(title, img, message) {
Object.assign(this, { title, img, message });
}
}
const audio = new Audio('data:audio/wav;base64,//N0ZAAKARdKr6CUAAmIAdwBQBAAApAAoEAGMYxjG+QAZjAAEAAAAc5znP+pznQOAGAYBgGAYHD5zkIQhCN///OQhP/7f////+hA4AYHD5ygIAmD4Pg+93y7+D4P1HP//+IAQBD///////////wxBAEAQcJAQ4Pn/Z6wfBwMZQHwfB8H/ggCETg4CCq7S6XUa7JuDW63JKSyQg08gJ2CqqhXwEURD4m7//N0ZBwO1gV5L8GoAQlwAhgBgBAA6m0dVKs4zSUCkR4rgNvmCaJ7Gmmocd+VITkmmqVFtrpMGyIp5AF+cqEp6o30XbSYTmIxzMb6Rv/8fN/5o0J/3qZ/9e236vuK7WRlbP/YoNy3/9PeQiZ/+n0xl//////////33e1X36W/VUElB0R2vZSsHRWPG/2CIqKCH97BwYMV1uultBbkBYnq+qzNJg2KzVVh//N0ZBINWVtpL+SgAQlYAgwBwBAAix3WksLwUbYNKJSzmZIq5//goAYF4CgPgBwbgsEQsWETSEiEm0dHZaZmv+v4/9pjuZS5mL7+bji/////////hmooWGmDxx5DGO9wiJcJlvuhKf6WzX//1EP///////////V/lNbUrdHuJNUlsJB+9jRwJjhhYRjRYAMHHzi0Krt9upiIYUfYFC+IcBr3uuB8oQXp//N0ZBQM9Itljz0PWgibqggAAAUcbiObpfjlllu9b2+trDXr3X06Q6fDEitg6GgEICVA5gCQkoGcAeAQAMgcidfhw34cuLseg4YBUQgQeBAwsGAGEg0DT1fV/VMBMBPJB0JGTJkan/9v/p6J07X3eeqlnJfvaykctLO63PaUy3MrodVu9qnIioUgxKmZh4mIgT
View dein_rust_lazy.toml
## TOML for Cargo.toml
[[plugins]]
repo = 'cespare/vim-toml'
on_ft = 'toml'
## Rust
### rust-lang/rust.vim : Vim configuration and syntax highlight for Rust.
[[plugins]]
repo = 'rust-lang/rust.vim'
on_ft = 'rust'
View state.rb
class State
def initialize(&block)
@block = block
end
def self.state(&block)
State.new(&block)
end
def self.put(state)
View test_deref.rs
use std::ops::Deref;
struct DerefExample<T> {
value: T
}
impl<T> Deref for DerefExample<T> {
type Target = T;
fn deref(&self) -> &T {
View token_tree.rs
enum Literal { Int(i32), }
enum Term<'a> { OpTree(&'a OpTree<'a>), Literal(Literal) }
enum OpType { Add, Sub, Mul, Div }
struct OpTree<'a>(OpType, Term<'a>, Term<'a>);
impl ToString for OpType {
fn to_string(&self) -> String {
View parser-combinator.rs
use std::error::Error;
use std::iter::FromIterator;
use std::fmt;
#[derive(Debug)]
struct ParseError {
message: &'static str,
}
impl ParseError {