Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
# Python 3.10 switch case example for a list | |
def file_handler_v1(command): | |
match command.split(): | |
case ["show"]: | |
print("List all files and directories: ") | |
# code to list files | |
case ["remove", *files]: | |
print("Removing files: {}".format(files)) | |
# code to remove files | |
case _: |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
from collections import Counter | |
import pandas as pd | |
data = [["A", 1], ["A", 2], ["B", 5], ["B", 5], ["B", 4], ["C", 6]] | |
df = pd.DataFrame(data, columns=["name", "id"]) | |
id_all = df.groupby("name")["id"].agg(list) | |
id_unique = df.groupby("name")["id"].agg(set) |
from os import listdir, path, remove, walk | |
from json import dump, load | |
from re import sub | |
dir = "data" | |
def createJSON(): | |
fileName = input("> Title: ") |
from functools import wraps | |
from django.http import HttpResponseNotAllowed | |
def require_http_methods(method_list): | |
""" | |
Decorator to make a view only accept particular request methods. Usage:: | |
@require_http_methods(["GET", "POST"]) | |
def my_view(request): | |
""" |
<!DOCTYPE html> | |
<html lang="en" class="h-100"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content="Blacksmithop"> | |
<meta name="generator" content="Hugo 0.88.1"> | |
<title>Index of - Blacksmithop</title> |
from requests import get | |
from bs4 import BeautifulSoup | |
class Novel: | |
""" | |
Represents a novel. | |
""" | |
def __init__( |