Skip to content

Instantly share code, notes, and snippets.

View tsotetsi's full-sized avatar
🛠️
Building

Thapelo Tsotetsi tsotetsi

🛠️
Building
View GitHub Profile
@tsotetsi
tsotetsi / tkinter_share_data
Created June 15, 2021 09:50
Python tkinter sharing data across different screens
from tkinter import *
class SharingInformation:
def __init__(self):
self.query = StringVar()
def main_frame(self, main_window):
main_window.title("Main Window")
main_window.geometry("150x150")
@tsotetsi
tsotetsi / data
Created August 28, 2020 12:28
data-file
{
"mancoName": "Sanlam Collective Investments",
"mancoEntityNumber": 0,
"portfolio": {
"currencyCode": "ZAR",
"currencySymbol": "R",
"entityNumber": 351032109,
"mancoEntityNumber": 0,
"mancoName": "Sanlam Collective Investments",
"totalMarketValue": 0,
@tsotetsi
tsotetsi / gist:3b7446eb0a6d355dd8a0b6a56913eddc
Created March 20, 2020 12:24
LC-Python-Built-in functions/modules-Tasks
# A program to calculate the average mark for a student, given three class test's marks.
from datetime import datetime, timedelta
name = input("Please enter your name: ")
surname = input("Please enter your surname: ")
marks = input("Please enter your class test marks(out of 100) separated by spaces: ")
# A function to calculate the student semester average mark.
# A program which demonstrate basic
# hotel booking management system.
# A function to calculate
# the total costs for a hotel stay.
def hotel_cost(nights):
cost_per_night = 140 # in rands
@tsotetsi
tsotetsi / media-query.css
Created June 22, 2018 09:14 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@tsotetsi
tsotetsi / richhickey.md
Created April 19, 2018 11:28 — forked from prakhar1989/richhickey.md
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

AF|Afghanistan|Afghan
AL|Albania|Albanian
DZ|Algeria|Algerian
AS|American Samoa|American Samoa
AD|Andorra|Andorran
AO|Angola|Angolan
AI|Anguilla|Anguillian
AQ|Antarctica|None
AG|Antigua And Barbuda|Antiguan or Barbudan
AR|Argentina|Argentinian
@tsotetsi
tsotetsi / fabfile.py
Created May 24, 2017 06:25 — forked from roselleebarle04/fabfile.py
Simple django fabric script for deployment
import os
import sys
from fab_deploy import *
from fabric.contrib.console import confirm
from fabric.api import env, cd, prefix, local, sudo as _sudo, run as _run, hide, task, settings, abort
from fabric.contrib.files import exists, upload_template
from fabric.colors import yellow, green, blue, red
from fabric.operations import _prefix_commands, _prefix_env_vars
from contextlib import contextmanager
@tsotetsi
tsotetsi / Vhostman-nginx.bash
Created July 26, 2016 07:40 — forked from willwade/Vhostman-nginx.bash
VhostMan-Nginx. A small script (and other bits) for creating virtual hosts with Nginx. Use as you wish. Download all the components - put in your path somewhere and run with vhostman-nginx.sh create domain.com app name. It doesn't need the gunicorn_start file if you don't need that.
#!/bin/bash
### Set default parameters
# somewhat follows the conventions from: http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/
# designed to run on a debian symbiosis box if your interested why its /srv
action=$1
domain=$2
appname=$3
owner=$(who am i | awk '{print $1}')
sitesEnable='/etc/nginx/sites-enabled/'
sitesAvailable='/etc/nginx/sites-available/'