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
# Run this Python 3 script with superuser rights ('sudo') to install the Signal client | |
input("Welcome to the signal-cli install wizard.\nPress ENTER when you are ready.") | |
import os | |
yes = ['Oui', 'Yes', 'O', 'Y', 'oui', 'yes', 'o', 'y'] | |
javaInstalled = input( |
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
""" | |
Resize an animated GIF to 512 x 512 by scaling the photo to fit | |
then padding the remaining space with the color of the topleft pixel. | |
Note: May not work well with GIFs with transparency. | |
To turn GIFs into animated stickers for Signal, resize them with this script before | |
converting them to APNG with the gif2apng CLI (http://gif2apng.sourceforge.net/). | |
""" |
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
""" | |
Generate a random tree with n nodes using a Prüfer sequence. | |
Can be used for creating test cases in competitive programming. | |
Time complexity: O(n^2) | |
Algorithm: https://en.wikipedia.org/wiki/Pr%C3%BCfer_sequence | |
""" | |
import random |