Skip to content

Instantly share code, notes, and snippets.

View Xevion's full-sized avatar
⚜️
Noblesse Oblige

Xevion Xevion

⚜️
Noblesse Oblige
View GitHub Profile
>>> def max_penalized(n: float, penalty: float = 0.4) -> float:
return n + (100 - n) * (1 - penalty)
>>> max_penalized(85.56)
94.224
2022-03-30T07:14:44.969115+00:00 heroku[web.1]: State changed from crashed to starting
2022-03-30T07:14:53.852467+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2022-03-30T07:14:56.063853+00:00 heroku[web.1]: State changed from starting to up
2022-03-30T07:14:55.684562+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [4] [INFO] Starting gunicorn 20.1.0
2022-03-30T07:14:55.685249+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [4] [INFO] Listening at: http://0.0.0.0:32157 (4)
2022-03-30T07:14:55.685322+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [4] [INFO] Using worker: sync
2022-03-30T07:14:55.704518+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [10] [INFO] Booting worker with pid: 10
2022-03-30T07:14:55.788814+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [11] [INFO] Booting worker with pid: 11
2022-03-30T07:15:04.154942+00:00 app[web.1]: Collecting en_core_web_sm==2.3.1
2022-03-30T07:15:04.319253+00:00 app[web.1]: Collecting en_core_web_sm==2.3.1
import math
import shutil
from typing import List
import imageio
import os
from PIL import Image, ImageDraw
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
IMG_OUT_DIRECTORY = os.path.join(SCRIPT_DIR, 'gif')
IMG_TEMP_OUT_DIR = os.path.join(IMG_OUT_DIRECTORY, 'temp')
import shutil
from typing import List
import imageio
import os
from PIL import Image, ImageDraw
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
IMG_OUT_DIRECTORY = os.path.join(SCRIPT_DIR, 'gif')
IMG_TEMP_OUT_DIR = os.path.join(IMG_OUT_DIRECTORY, 'temp')
IMG_TEMP_GLOB = os.path.join(IMG_TEMP_OUT_DIR, '*.png')
import shutil
from typing import List
import imageio
import os
from PIL import Image, ImageDraw
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
IMG_OUT_DIRECTORY = os.path.join(SCRIPT_DIR, 'gif')
IMG_TEMP_OUT_DIR = os.path.join(IMG_OUT_DIRECTORY, 'temp')
IMG_TEMP_GLOB = os.path.join(IMG_TEMP_OUT_DIR, '*.png')
from typing import List
class Color(object):
def __init__(self, r: float, g: float, b: float, a: float = 1.0) -> None:
self.r, self.g, self.b, self.a = r, g, b, a
def __str__(self) -> str:
return f'Color({self.r}, {self.g}, {self.b}, {self.a:.2%})'
def __repr__(self) -> str:
<tbody>
<tr class="ch-tbl-row odd" role="row">
<td class="ch-tbl-name sorting_1"></td>
<td class="ch-tbl-short-name">ammo.snowballgun</td>
<td class="ch-tbl-id">550753330</td>
<td class="ch-tbl-desc"></td>
<td class="ch-tbl-stack-size">128</td>
</tr>
<tr class="ch-tbl-row even" role="row">
<td class="ch-tbl-name sorting_1">12 Gauge Buckshot</td>
<#
.SYNOPSIS
Given students' names along with the grade that they are in, create a roster for the school.
.DESCRIPTION
In the end, you should be able to:
Add a student's name to the roster for a grade
"Add Jim to grade 2."
"OK."
Get a list of all students enrolled in a grade
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="@dimen/color_item_frame_corner_radius"/>
<stroke
android:width="@dimen/color_item_frame_width"
android:color="@color/colorColorItemFrame"/>
import enum
from typing import List, Optional, Tuple
from termcolor import colored
class CellType(enum.Enum):
EMPTY = ' '
WALL = colored('#', color='white', attrs=['bold'])
MONSTER = colored('M', color='red')
MONSTER_FOG = colored('+', color='green')