View nestedError.ts
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
export class NestedError<ErrorLike extends Error> extends Error { | |
private nestedError: ErrorLike; | |
constructor(config: { message?: string; nestedError: ErrorLike }) { | |
const { message = "", nestedError } = config; | |
super(message); | |
this.nestedError = nestedError; |
View denoRun.ts
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
export function denoRun(args: string[], options: Partial<Deno.RunOptions> = {}) { | |
return Deno.run({ | |
cmd: ["deno", ...args], | |
stdout: "null", | |
stderr: "null", | |
...options, | |
}); | |
} |
View lint.ts
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
#!/usr/bin/env -S deno run --allow-run | |
const checkFormatprocess = Deno.run({ | |
cmd: ["deno", "fmt", "--check", "."], | |
stdout: "null", | |
stderr: "null", | |
}); | |
const lintProcess = Deno.run({ | |
cmd: ["deno", "lint", "."], |
View brainfuck.cpp
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
#include <fstream> | |
#include <iostream> | |
#define SOURCE_SIZE 10000 | |
#define MEMORY_SIZE 30000 | |
using std::cout; | |
using std::endl; | |
void bf_execute(char *src, int *mem, int loop) { |
View over_complicated.py
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
VALID_VOWELS = ["A", "E", "I", "O", "U", "a", "e", "i", "o", "u"] | |
consonants = "bcdfghjklmnpqrstvwxz" + "BCDFGHJKLMNPQRSTVWXZ" | |
def is_vowel(string): | |
return string in VALID_VOWELS | |
RULERS = {"vowels": "Alice", "consonants": "Bob", "y": "nobody"} |
View main.rs
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
use std::env; | |
const DEFAULT_PORT: u16 = 3000; | |
const DEFAULT_SERVER_MODE: &str = "DEV"; | |
fn main() { | |
let server_port = env::var("SERVER_PORT").unwrap_or(DEFAULT_PORT.to_string()); | |
let server_mode = env::var("SERVER_MODE").unwrap_or(DEFAULT_SERVER_MODE.to_string()); | |
println!( |
View dissect_old_collector.go
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
package main | |
import ( | |
"bytes" | |
"context" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"log" |
View gpu.render.canvas.js
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 size = 10.0; | |
const clr = 0.0; | |
const ps = 0.0; | |
rust | |
.then((canvas) => { | |
var nodes = document.getElementsByTagName("button"); | |
for (var i = 0; i < nodes.length; i++) { | |
nodes[i].addEventListener( |
View swc_tsx.rs
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
use std::{path::Path, sync::Arc}; | |
use swc::{ | |
self, | |
config::{JscConfig, Options}, | |
}; | |
use swc_common::{ | |
errors::{ColorConfig, Handler}, | |
SourceMap, | |
}; |
View server.rs
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
use colored::Colorize; | |
use open::that; | |
use std::{ | |
io::prelude::*, | |
net::{TcpListener, TcpStream}, | |
}; | |
use tungstenite::{ | |
accept_hdr, | |
handshake::server::{Request, Response}, | |
}; |
NewerOlder