This file contains 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
"""SQLAlchemy MCVE.""" | |
from sqlalchemy import create_engine, Column, Integer, String, Table, ForeignKey | |
from sqlalchemy.orm import sessionmaker, relationship | |
from sqlalchemy.ext.declarative import declarative_base | |
engine = create_engine( | |
'mysql+pymysql://*******:*******@localhost/sqlalchemy_mcve') | |
Base = declarative_base(bind=engine) | |
Session = sessionmaker(bind=engine) | |
session = Session() |
This file contains 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
"""Python DocStrings Tutorial.""" | |
def my_function(): | |
"""Do nothing and return None.""" | |
return None | |
class MyClass: | |
""" |
This file contains 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
server { | |
listen 127.0.0.1:9000; | |
location / { | |
proxy_pass http://unix:/var/run/docker.sock:/; | |
} | |
} |
This file contains 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
$ apt update && apt upgrade -y # Update packages list and the packages | |
$ apt install sudo # Install 'sudo' | |
$ adduser coolguy # Create a new user | |
$ visudo # Add new user to the sudo users | |
# Disconnect root session | |
# SSH using the new user |
This file contains 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> | |
char * reverseWords(const char *text); | |
char * reverseWord(char *word); | |
int main () { | |
char *text = "Hello World"; | |
char *result = reverseWords(text); | |
printf("%s == %s\n", result, "olleH dlroW"); |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am darksunium on github. | |
* I am darksunium (https://keybase.io/darksunium) on keybase. | |
* I have a public key ASD9OJeHW1MXZ0y4I-gePkK2rkP4AoHAiJkyphOYB3PHDwo | |
To claim this, I am signing this object: |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
An example flask application showing how to upload a file to S3 | |
while creating a REST API using Flask-Restful. | |
Note: This method of uploading files is fine for smaller file sizes, | |
but uploads should be queued using something like celery for | |
larger ones. | |
""" | |
from io import BytesIO |