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
interface Pizza { | |
type: "pizza"; | |
slices: number; | |
} | |
interface Hamburger { | |
type: "hamburger"; | |
vegetarian: boolean; | |
} |
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; |
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, | |
}); | |
} |
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", "."], |
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) { |
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"} |
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!( |
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" |
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( |
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, | |
}; |