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
# This Pylint rcfile contains a best-effort configuration to uphold the | |
# best-practices and style described in the Google Python style guide: | |
# https://google.github.io/styleguide/pyguide.html | |
# | |
# Its canonical open-source location is: | |
# https://google.github.io/styleguide/pylintrc | |
[MAIN] | |
# Files or directories to be skipped. They should be base names, not paths. |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"newline": true, | |
"segments": [ | |
{ | |
"background": "#26BDBB", | |
"foreground": "#0C212F", |
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
from math import sqrt, acos, degrees | |
class KeyboardDistance: | |
def __init__(self, rows=None, offset=None, key_size=19.05): | |
rows = rows or ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'] | |
offset = offset or [0, 0.25, 0.75] | |
self.vectors = {} |
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
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: coffee-svc | |
labels: | |
app: coffee | |
spec: | |
ports: | |
- port: 80 |
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 turtle | |
import colorsys | |
def position(x, y): | |
square = max(abs(x), abs(y)) | |
return 1 + 4*square*square + (-1, 1)[x<=-y]*(abs(square + x) + | |
abs(square - y)) | |
turtle.setworldcoordinates(-28, -28, 28, 28) | |
turtle.ht() |
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
from random import randint | |
class MillerRabin: | |
@staticmethod | |
def power_mod(a, b, c): | |
"""Calculate a^b % c using exponentiation by squaring.""" | |
if c == 1: | |
return 0 | |
r = 1 | |
a = a % c |
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
def StarsAndBars(bins, stars, reverse=False, allowEmpty=True): | |
""" | |
Non-recursive generator that returns the possible ways that n | |
indistinguishable objects can be distributed between k distinguishible bins | |
(allowing empty bins). | |
Total # arrangements = (n+k-1)! / n!(k-1)! if empty bins are allowed | |
Total # arrangements = (n-1)! / (n-k)!(k-1)! if empty bins are not allowed | |
Parameters |