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
# | |
# Simple code editor with syntax highlighting | |
# | |
# import Libraries | |
import tkinter as tk | |
from tkinter import ttk | |
from tkinter import filedialog | |
# create new file |
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
import os | |
import paramiko | |
paramiko.util.log_to_file('/tmp/paramiko.log') | |
paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts')) | |
host = 'local' | |
port = 22 | |
username = 'user' | |
files = ['file1', 'file2', 'file3', 'file4'] |
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
# login to heroku | |
heroku login | |
# init empty repo | |
git init | |
# create app | |
heroku create your-first-heroku-app --buildpack heroku/python | |
# add remote git |
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
# install pip | |
sudo apt-get update | |
sudo apt-get install python3-pip | |
sudo pip3 install setuptools | |
sudo pip3 install wheel | |
# install requests | |
sudo pip3 install requests | |
# install beautiful soup |
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
# initial user setup | |
$ git config --global user.name "John Doe" | |
$ git config --global user.email johndoe@example.com |
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
from flask import Flask, render_template | |
from flask_paginate import Pagination, get_page_args | |
app = Flask(__name__) | |
app.template_folder = '' | |
users = list(range(100)) | |
def get_users(offset=0, per_page=10): |
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
from flask import Flask, request, jsonify | |
from flask_sqlalchemy import SQLAlchemy | |
from flask_marshmallow import Marshmallow | |
import os | |
# init app | |
app = Flask(__name__) | |
# SQLite database connection |
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
######################################## | |
# | |
# A simple binary Markov chain model | |
# | |
######################################## | |
import random | |
import matplotlib, matplotlib.pyplot as plt | |
matplotlib.use('tkagg') |
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
# general | |
SHOW DATABASES; | |
USE database_name; | |
SHOW TABLES; | |
SELECT * FROM table_name WHERE column_name LIKE "%search_keyword%"; | |
SELECT * FROM table_name ORDER BY id_column LIMIT 10; | |
# create table | |
CREATE TABLE EMPLOYEE ( | |
FIRST_NAME CHAR(20) NOT NULL, |
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
CYysDku47TeqYIT3 |