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 UIKit | |
import WebKit | |
// This gist assumes you already have a UITableView setup | |
// This gist is designed to look like Reddit's DetailViewController, HOWEVER | |
// The point of a WKWebView is that images can be loaded | |
// This gist is NOT perfect; look in comments for what needs to be fixed. | |
class ViewController: UIViewController, WKNavigationDelegate { |
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
// THIS CODE DOES NOT SHOW THE HTML. The Gist is for an SO question and for future references. | |
import UIKit | |
import WebKit | |
class TableVC: UIViewController, WKNavigationDelegate { | |
let headerView = UITableViewHeaderFooterView() | |
let titleView = UILabel() | |
let webView = WKWebView() | |
override func viewDidLoad() { |
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 UIKit | |
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { | |
var tableView: UITableView! | |
private var fetchingMore = false | |
var delay: Double! | |
var items = [[Any]]() | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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 UIKit | |
import RichEditorView. // TODO: Download https://github.com/cbess/RichEditorView for Swift 5 support | |
class EditorViewController: UIViewController, RichEditorDelegate { | |
let editorView = RichEditorView() | |
var isEditingText: Bool! | |
var initString: String! | |
var prevText: String! | |
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
''' | |
As of August 15, 2019, using Python 3.7.4, PySimpleGUI == 4.1.0, macOS 10.14.6, macOS users will have trouble using scrolling or scrollable windows if you are using the Column layout method. The issue is a large portion of the bottom is unable to be in view, unless the user manually resizes the window by at least a few pixels. | |
EDIT: The formula works for any layering of elements in a scrollable window! So you can have a row with Text, a row with multiline, a row with buttons. It does not matter. The formula always works! | |
TL;DR Just add a final element in your layer with top padding like so: | |
layer += [sg.Text("Whatever you want. Maybe copyright", pad=(0, (22.5 * NUMBER_OF_ROWS - 13.0357, 0)))] |
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
""" | |
First go here: | |
https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted | |
Download your preferred package based off your Python version by clicking on the name wanted. I HIGHLY recommend the 32-bit. (When installing with the 64-bit AMD version, I received an error saying the package was not supported). | |
Find where the package was downloaded. Usually, it's in C:\Users\(username)\Downloads | |
If this is your path: | |
""" | |
path = 'C:\Users\(username)\Downloads' | |
""" |
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
"""Django oversized migration file. Missing two fields (ArrayFields) for the sake | |
of renaming a bunch of stuff in a different project. Overall 5970 lines""" | |
"""I have this system for a VERY/EXTREMELY specific application, so please don't recommend | |
reworking the models. This is using Django-Tagulous. Two fields have a tagulous field.""" | |
# For https://stackoverflow.com/questions/56213264/migrations-file-too-large-preventing-migrate | |
# Generated by Django 2.2.1 on 2019-05-20 19:11 | |
from django.conf import settings | |
from django.db import migrations, models | |
import django.db.models.deletion |