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
body | |
&::after | |
content: 'Error, this should not display!' | |
@for $i from 0px through 2161px | |
@media (height: $i) | |
&::after | |
content: 'Height: #{$i}' |
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
/bin/sh | |
# Automatically compiles and views a pdf from Groff. [Requires Zathura, entr] | |
if [ $# -eq 0 ] || [ "$1" == "-h" ] ; then | |
echo "Usage: \$0 \$1" | |
echo " \$0 The name of the ms document you wish to autocompile." | |
echo " \$1 The name of the output." | |
exit | |
fi |
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 None = Symbol("None"); | |
const DefaultErr = Symbol("Err"); | |
type Option<T> = ((s: (val: T) => T) => T) | typeof None; | |
type Some<T> = (val: T) => Option<T>; | |
const Some: <T>(val: T) => Option<T> = (val) => (s) => s(val); | |
type Result<T, E> = (o: (val: T) => E, s: (val: symbol) => E) => E; | |
type Err<T> = T; | |
const Err: <A, B>(val: symbol) => Result<A, B> = (val: symbol) => (_, g) => |
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 None = Symbol("None"); | |
const DefaultErr = Symbol("Err"); | |
type Option<T> = ((s: (val: T) => T) => T) | typeof None; | |
type Some<T> = (val: T) => Option<T>; | |
const Some: <T>(val: T) => Option<T> = (val) => (s) => s(val); | |
type Result<T, E> = (o: (val: T) => E, s: (val: symbol) => E) => E; | |
type Err<T> = T; | |
const Err: <A, B>(val: symbol) => Result<A, B> = (val: symbol) => (_, g) => |
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 actix_web::http::header::HeaderMap; | |
use chrono::{DateTime, Utc}; | |
use std::collections::HashMap; | |
use std::sync::Mutex; | |
#[derive(Debug, Clone)] | |
pub struct Fingerprint { | |
properties: Vec<(String, String)>, | |
fonts: Vec<String>, | |
headers: HeaderMap, |
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 divide(left: number, right: number): Result<number, Error> { | |
if (right === 0) return Err("Divided by zero"); | |
return Ok(left / right); | |
} | |
class DivisionError extends Error { | |
constructor(message: string) { | |
super(message); | |
} |
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
/** | |
* Similar to a standard Error, but with a custom message and status code field. | |
* @param status The status code of the error. | |
* @param message The message of the error. | |
*/ | |
export class HttpError extends Error { | |
name = "HttpError"; | |
status: number; | |
constructor(status: number, message: 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
/** | |
* @file Environment variables & configuration utilities. | |
*/ | |
import { EnvError } from "../errors/envError"; | |
import dotenv from "dotenv"; | |
dotenv.config(); | |
export enum Env { |
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] | |
name = "chat-server" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
tokio = { version = "1.20.1", features = ["full"] } |
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
/* eslint-disable no-prototype-builtins */ | |
/** | |
* A Rust-like Result class. | |
* | |
* Note: Please use either Ok or Err to construct Results. | |
* | |
* @example | |
* ``` | |
* function divide(left: number, right: number): Result<number, Error> { |