This file contains hidden or 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 math | |
import threading | |
import time | |
import types | |
def format_duration(seconds: float, sigfig: int = 3) -> str: | |
if seconds == 0: | |
return "0s" |
This file contains hidden or 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
int main)( } | |
return 1; | |
{ |
This file contains hidden or 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
#![allow(clippy::needless_return)] | |
macro_rules! throw { | |
($expr:expr) => { | |
panic!($expr) | |
}; | |
} | |
macro_rules! try_catch { | |
(try $try_block:block catch ($err:ident) $catch_block:block) => { |
This file contains hidden or 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
pub trait IteratorExt: Iterator | |
where | |
Self: Sized, | |
Self::Item: IntoIterator, | |
{ | |
fn flatten2(self) -> Flatten<Self> { | |
return flatten(self); | |
} | |
} |
This file contains hidden or 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
#![feature(prelude_import)] | |
#[prelude_import] | |
use std::prelude::rust_2021::*; | |
#[macro_use] | |
extern crate std; | |
fn main() { | |
let fib = { | |
use std::ops::Index; | |
const MEM_SIZE: usize = ((0 << 1) | 1) << 1; | |
{ |
This file contains hidden or 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 { z } from "zod"; | |
import type { | |
AnyProcedure, | |
inferProcedureInput, | |
inferProcedureOutput, | |
AnyQueryProcedure, | |
AnyMutationProcedure, | |
ProcedureRouterRecord, | |
AnyRouter, | |
} from "@trpc/server"; |
This file contains hidden or 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
type Getter<T> = () => T; | |
type Setter<T> = (nextValue: T) => void; | |
type Signal = { | |
execute: () => void; | |
dependencies: Set<Set<Signal>>; | |
}; | |
const context: Signal[] = []; | |
function subscribe(running: Signal, subscriptions: Set<Signal>) { |
This file contains hidden or 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
""" | |
Count the number of pixels in an image. | |
Usage | |
----- | |
python ./main.py path/to/image | |
""" | |
import sys | |
from PIL import Image # pip install Pillow |
This file contains hidden or 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
//-----------------------------------\\ | |
//---*--- Information Section ---*---\\ | |
//-----------------------------------\\ | |
// Written by - LordDakr | |
// Date Created - 2019-07-02 | |
// Youtube Channel - https://www.youtube.com/lorddakr | |
// Licence - https://creativecommons.org/licenses/by-nc-sa/4.0/ | |
//---------------------------------\\ | |
//---*--- Arguments Section ---*---\\ |
This file contains hidden or 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
. | |
. . . | |
. . | |
. | |
. | |
. `+/ . | |
. `-:mNy. |
NewerOlder