Skip to content

Instantly share code, notes, and snippets.

Avatar
🐦
All we are is an isle of flightless birds

John DrBeta

🐦
All we are is an isle of flightless birds
View GitHub Profile
@DrBeta
DrBeta / Dilbert.py
Last active May 31, 2020
Dilbert.py
View Dilbert.py
import requests
import urllib.request
import time
from bs4 import BeautifulSoup
import io
import datetime
import urllib
from PIL import Image
def DilbertURL(dateToFetch):
@DrBeta
DrBeta / README.md
Last active Dec 17, 2019
Programmatic layout in iOS 13
View README.md

You sometimes need to have a programmatic layout when making iOS apps. But, if you have been playing around with the Xcode beta, you might notice that your old code to do that doesn't work. This code is used in the func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) in SceneDelegate.swift to initialize the programmatic layout. There is also a Storyboard name in the Info.plist you have to delete. Happy coding!

@DrBeta
DrBeta / main.dart
Last active May 15, 2019
Stream Example
View main.dart
import 'dart:async';
class Cake {}
class Order {
String type;
Order(this.type);
}
void main() {
@DrBeta
DrBeta / wait.swift
Created Jan 26, 2019
This is a easy to use function that you can add to any swift code that waits for a time you specify in the "time" parameter.
View wait.swift
// Created by Dr.Beta
import Foundation
import UIKit
//Put the amount of seconds in the 'time' parameter.
func wait(time: UInt32) {
sleep(time)
}
//This line waits for 4 seconds
wait(time: 4)
//Now do whatever you want, in this case I print "It has been 4 seconds".