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 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): | |
| """ |
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
| <!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> |
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 requests import get | |
| from bs4 import BeautifulSoup | |
| class Novel: | |
| """ | |
| Represents a novel. | |
| """ | |
| def __init__( |
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
| class Map(dict): | |
| """ | |
| Example: | |
| m = Map({'first_name': 'Eduardo'}, last_name='Pool', age=24, sports=['Soccer']) | |
| """ | |
| def __init__(self, *args, **kwargs): | |
| self.update(*args,**kwargs) | |
| if kwargs: | |
| for k, v in kwargs.items(): |
I hereby claim:
- I am blacksmithop on github.
- I am blacksmithop (https://keybase.io/blacksmithop) on keybase.
- I have a public key ASBuWejMzpZk8vQ4xQ36WZDOfeSjPTP4PDuNZw1yygZquQo
To claim this, I am signing this object:
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 discord.ext import commands | |
| from discord import Status, Game | |
| from discord.errors import LoginFailure | |
| bot = commands.Bot(command_prefix="?") | |
| @bot.listen('on_ready') | |
| async def bot_is_ready(): | |
| print(f"Logged in as: {bot.user}") | |
| await bot.change_presence(status=Status.online, activity=Game(f"{bot.command_prefix}help")) |
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 sqlite3 | |
| from pprint import pprint | |
| class DB: | |
| def __init__(self): | |
| self.con = sqlite3.connect('newdb.db') | |
| self.cur = self.con.cursor() | |
| def view_table(self): | |
| self.cur.execute("Select * from NEW") |
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
| #include <stdio.h> | |
| #include <string.h> | |
| void main(){ | |
| char icode[10][30], str[30], opr[30]; | |
| int i=0; | |
| printf("Enter Intermediate Code (terminated by exit):\n"); | |
| do{ | |
| scanf("%s", icode[i]); |
