Share beautiful code snippets by using the Github Gists <> Carbon App integration!
The idea is simple:
-
Identify your github gist's ID
https://gist.github.com/<user>/<gist-id>
-
Append it into the carbo-app URL
import json | |
import datetime as dt | |
import requests | |
import matplotlib.pyplot as plt | |
from matplotlib.animation import FuncAnimation | |
import pandas as pd | |
GIST_URL = "https://gist.githubusercontent.com/RHDZMOTA/db699a97eef5e77ca4d072a8ba1a7f48/raw/6d45c74d93a72a4e38fb8ad17dd8983e76e76109/gamestop-jan2021.json" |
import secrets | |
import string | |
def get_random_string( | |
length: int, | |
case_sensitive: bool = False, | |
include_digits: bool = False, | |
include_special_characters: bool = False | |
) -> str: |
from serializer import SimpleSerializer | |
from dataclasses import dataclass | |
@dataclass | |
class Something(SimpleSerializer['Something']): | |
name: str | |
value: int | |
{ | |
"name": "My Job Name", | |
"new_cluster": { | |
"spark_version": "7.5.x-scala2.12", | |
"node_type_id": "m4.xlarge", | |
"aws_attributes": { | |
"zone_id": "us-west-2a", | |
"instance_profile_arn": <AWS-PROFILE-ARN>, | |
"availability": "SPOT_WITH_FALLBACK", | |
"ebs_volume_type": "GENERAL_PURPOSE_SSD", |
from typing import Any, Iterator, Optional | |
def last(iterator: Iterator[Any]) -> Optional[Any]: | |
last = None | |
for last in iterator: | |
continue | |
return last | |
import os | |
import argparse | |
from typing import Optional | |
DEFAULT = os.environ.get("DEFAULT", "world") | |
def hello(name: Optional[str] = None): | |
print(f"Hello, {name or DEFAULT}.") | |
manage() { | |
local command="${1}" | |
case "${command}" in | |
install) | |
case "${OSTYPE}" in | |
msys) | |
echo "Installing pyenv-win" | |
git clone https://github.com/pyenv-win/pyenv-win.git "${HOME}/.pyenv-github" | |
ln -s "${HOME}/.pyenv-github/pyenv-win" "${HOME}/.pyenv" |
import os | |
HELLO_WORLD_DEFAULT = os.environ.get( | |
"HELLO_WORLD_DEFAULT", | |
default="World" | |
) | |
def hello(world: str = HELLO_WORLD_DEFAULT) -> str: | |
return f"Hello, {world}!" |
32.502345269453031 | 31.70700584656992 | |
---|---|---|
53.426804033275019 | 68.77759598163891 | |
61.530358025636438 | 62.562382297945803 | |
47.475639634786098 | 71.546632233567777 | |
59.813207869512318 | 87.230925133687393 | |
55.142188413943821 | 78.211518270799232 | |
52.211796692214001 | 79.64197304980874 | |
39.299566694317065 | 59.171489321869508 | |
48.10504169176825 | 75.331242297063056 | |
52.550014442733818 | 71.300879886850353 |