Discover gists
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
# BASIC TKINTER CHEATSHEET | |
# Build basic GUIs with Python | |
from tkinter import * | |
from tkinter import scrolledtext | |
from tkinter import messagebox | |
from tkinter.ttk import Progressbar | |
from tkinter import filedialog | |
from tkinter import Menu |
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
--paletteColor1 -----> --theme-palette-color-1 | |
--paletteColor2 -----> --theme-palette-color-2 | |
--paletteColor3 -----> --theme-palette-color-3 | |
--paletteColor4 -----> --theme-palette-color-4 | |
--paletteColor5 -----> --theme-palette-color-5 | |
--paletteColor6 -----> --theme-palette-color-6 | |
--paletteColor7 -----> --theme-palette-color-7 | |
--paletteColor8 -----> --theme-palette-color-8 | |
--fontFamily -----> --theme-font-family |
With Python
Dr. Yves J. Hilpisch | The Python Quants & The AI Machine
Python for Quant Finance Meetup, London, 16. November 2022
(short link to this Gist: http://bit.ly/pqf_risk)
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
**COMPLEX SPINNER** | |
#!/bin/bash | |
#Shows a spinner while another command is running. Randomly picks one of 12 spinner styles. | |
#@args command to run (with any parameters) while showing a spinner. | |
#E.g. ‹spinner sleep 10› | |
function shutdown() { | |
tput cnorm # reset cursor | |
} | |
trap shutdown EXIT |
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
#!/bin/bash | |
# | |
# This file echoes a bunch of color codes to the terminal to demonstrate | |
# what's available. Each line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a test use of that color | |
# on all nine background colors (default + 8 escapes). | |
# | |
T='gYw' # The test text | |
echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m"; | |
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m'; |
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
using System; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Text.Json; | |
using System.Text.RegularExpressions; | |
var http = new HttpClient(); | |
// Here is image, i.e. File.ReadAllBytes("smth.png"); | |
var file = new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 44, 0, 0, 0, 44, 8, 6, 0, 0, 0, 30, 132, 90, 1, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0, 154, 156, 24, 0, 0, 5, 194, 105, 84, 88, 116, 88, 77, 76, 58, 99, 111, 109, 46, 97, 100, 111, 98, 101, 46, 120, 109, 112, 0, 0, 0, 0, 0, 60, 63, 120, 112, 97, 99, 107, 101, 116, 32, 98, 101, 103, 105, 110, 61, 34, 239, 187, 191, 34, 32, 105, 100, 61, 34, 87, 53, 77, 48, 77, 112, 67, 101, 104, 105, 72, 122, 114, 101, 83, 122, 78, 84, 99, 122, 107, 99, 57, 100, 34, 63, 62, 32, 60, 120, 58, 120, 109, 112, 109, 101, 116, 97, 32, 120, 109, 108, 110, 115, 58, 120, 61, 34, 97, 100, 111, 98, 101, 58, 110, 115, 58, 109, 101, 116, 97, 47, 34, 32, 120, 58, 120, 109, 112, 116, 107, 61, 34, 65, 100, 111, 98, 101, 32, 88, |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Windows.Forms; | |
using Microsoft.Win32; | |
namespace RunOnStartup | |
{ | |
/// <summary> | |
/// It attempts to write to HKEY_LOCAL_MACHINE first, which will run on startup on all user accounts. |
NewerOlder