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 program goes through dictionary of lists containing | |
# different students in different divisions of a classs | |
# and finds a single student who has passed with above 80% score | |
divisions = { | |
'division A': [ | |
{'name': 'Student 1', 'pass': False, 'percent': 10}, | |
{'name': 'Student 2', 'pass': True, 'percent': 50}, | |
{'name': 'Student 3', 'pass': True, 'percent': 77}, | |
{'name': 'Student 4', 'pass': True, 'percent': 90} |
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
# Might not seem like a big deal in the example but in | |
# big projects where there's a lot of control flows branching out | |
# into unmanageable mess, this will be useful. | |
# Biggest takeaway is, try to terminate/break/eliminate an edge case in a block and | |
# continue the expected control flow in the same indentation level (previous block) | |
a = { | |
'name': 'John Doe', | |
'age': '33', |
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 PIL import Image | |
# 0.2 = take max 20% of the canvas size | |
thumbnail_factor = 0.2 | |
watermark_padding = 0.05 | |
# (w, h) | |
POS_TOPLEFT = (0, 0) | |
POS_TOPRIGHT = (1, 0) | |
POS_BOTTOMLEFT = (0, 1) |
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
enum TimeDuration | |
{ | |
case days(_: UInt) | |
case hours(_: UInt) | |
case minutes(_: UInt) | |
case seconds(_: UInt) | |
case muxed([TimeDuration]) | |
case zero | |
var rawValue: UInt |
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
// | |
// Theme.swift | |
// SHSH Host | |
// | |
// Created by ninja on 31/12/19. | |
// Copyright © 2019 arx8x.net. All rights reserved. | |
// | |
import UIKit |