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
"""NumPy/SciPy implementation of Conway's Game of Life. | |
https://bitstorm.org/gameoflife/ | |
""" | |
import argparse | |
import curses | |
import getopt | |
import time | |
from itertools import repeat |
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
import argparse | |
import warnings | |
class DeprecateAction(argparse.Action): | |
def __call__(self, parser, namespace, values, option_string=None): | |
warnings.warn("Argument %s is deprecated and is *ignored*." % self.option_strings) | |
delattr(namespace, self.dest) | |
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
import functools | |
import gc | |
import itertools | |
from timeit import default_timer as _timer | |
_repeat = functools.partial(itertools.repeat, None) | |
def timeit(repeat=3, number=1000): | |
"""Decorator: prints time from best of `repeat` trials. |
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
"""Demonstrates different LogRecord attributes (formatters). | |
https://docs.python.org/3/library/logging.html#logrecord-attributes | |
""" | |
import logging | |
# Notes | |
# ----- | |
# pathname: this is relative! | |
# created: time in seconds since the epoch as a float |
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
sudo -s | |
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm | |
dnf install -y yum-utils | |
dnf install -y https://yum.puppetlabs.com/puppet-release-el-8.noarch.rpm | |
dnf install -y https://download.simp-project.com/simp-release-community.rpm | |
dnf install -y simp |
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
>>> b"Added in d0b1708f".hex() | |
'416464656420696e206430623137303866' |
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
DESCRIPTION & SIGNATURE | |
Signature (minus some options you don't need): | |
find [starting-point...] [expression] | |
GNU find searches the directory tree rooted at each given `starting-point` by | |
evaluating the given `expression` from left to right. | |
If no `starting-point` is specified, `.` is assumed. |
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 greet(person: string) { | |
return "Hello, " + person; | |
} | |
console.log(greet("you")); | |
console.log(greet([1, 2, 3])); |
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
module.exports = { | |
"extends": [ | |
"eslint:recommended", | |
"plugin:@typescript-eslint/eslint-recommended" | |
], | |
"parser": "@typescript-eslint/parser", | |
"plugins": [ | |
"@typescript-eslint" | |
], | |
}; |
NewerOlder