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
# /// script | |
# requires-python = ">=3.10" | |
# dependencies = [ | |
# "click", | |
# ] | |
# /// | |
""" | |
Run a set of type checkers on a given folder. | |
Usage: |
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 LS_COLORS="*~=0;38;2;147;161;161:bd=1;38;2;181;137;0;48;2;7;54;66:ca=0:cd=1;38;2;181;137;0;48;2;7;54;66:di=1;38;2;38;139;210:do=1;38;2;211;54;130;48;2;7;54;66:ex=1;38;2;133;153;0:fi=0;38;2;101;123;131:ln=1;38;2;42;161;152:mh=0:mi=1;38;2;220;50;47;48;2;7;54;66:no=0;38;2;101;123;131:or=1;38;2;220;50;47;48;2;7;54;66:ow=0:pi=1;38;2;181;137;0;48;2;7;54;66:rs=0;38;2;101;123;131:sg=0:so=1;38;2;211;54;130;48;2;7;54;66:st=0:su=0:tw=0:*.1=0;38;2;101;123;131:*.a=0;38;2;101;123;131:*.c=0;38;2;101;123;131:*.d=0;38;2;101;123;131:*.h=0;38;2;101;123;131:*.m=0;38;2;101;123;131:*.o=0;38;2;147;161;161:*.p=0;38;2;101;123;131:*.r=0;38;2;101;123;131:*.t=0;38;2;101;123;131:*.v=0;38;2;101;123;131:*.z=1;38;2;220;50;47:*.7z=1;38;2;220;50;47:*.ai=0;38;2;211;54;130:*.as=0;38;2;101;123;131:*.bc=0;38;2;147;161;161:*.bz=1;38;2;220;50;47:*.cc=0;38;2;101;123;131:*.cp=0;38;2;101;123;131:*.cr=0;38;2;101;123;131:*.cs=0;38;2;101;123;131:*.db=1;38;2;220;50;47:*.di=0;38;2;101;123;131:*.el=0;38;2;101;123;131:*.ex=0;38;2;101;123;131:*.fs=0;38 |
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
from datetime import datetime | |
import pytz | |
import tzlocal | |
utc_time_string = "2024-07-01T12:00:00" | |
utc_time = datetime.strptime(utc_time_string, "%Y-%m-%dT%H:%M:%S").replace( | |
tzinfo=pytz.utc | |
) | |
local_time = utc_time.astimezone(tzlocal.get_localzone()) |
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
// For background, see: https://unix.stackexchange.com/questions/405485/name-of-the-process-on-the-other-end-of-a-unix-pipe | |
use std::ffi::{OsStr, OsString}; | |
use std::fs::{self, File}; | |
use std::io::prelude::*; | |
use std::io::Result; | |
use std::os::unix::ffi::OsStrExt; | |
use std::path::Path; | |
#[derive(Debug, Clone, Copy)] |
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
from abc import ABC, abstractmethod | |
from typing import List | |
from random import randint | |
from enum import Enum | |
Fruits = List[int] | |
NUM_FRUITS = 4 | |
class PickFruit: |
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 <iostream> | |
struct todo_statement { | |
public: | |
todo_statement(const char* file, const int line) | |
: m_file(file), m_line(line) {} | |
template <typename T> | |
operator T() { | |
std::cerr << "Error: Remove todo() statement in " << m_file << ":" << m_line |
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
echo "int main() {}" > just-exit.c | |
gcc -O just-exit.c -o just-exit-c | |
echo "" > just-exit.py | |
echo "fn main() {}" > just-exit.rs | |
rustc -O just-exit.rs -o just-exit-rs | |
echo "" > just-exit.rb |
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
# Configuration for Alacritty, the GPU enhanced terminal emulator | |
# Any items in the `env` entry below will be added as | |
# environment variables. Some entries may override variables | |
# set by alacritty it self. | |
env: | |
# TERM env customization. | |
# | |
# If this property is not set, alacritty will set it to xterm-256color. |
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
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. |
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/python | |
import argparse | |
import json | |
import matplotlib.pyplot as plt | |
parser = argparse.ArgumentParser() | |
parser.add_argument("results", help="JSON file with benchmark results") | |
args = parser.parse_args() |
NewerOlder