This Gist has been moved to https://github.com/lbgists/ttk-progressbar-example.py.
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
#!/usr/bin/env python | |
# Tkinter (Tk/Ttk) Progressbar widget example | |
# | |
# Written by Yu-Jie Lin | |
# This code is placed in Public Domain | |
# | |
# Gist: https://gist.github.com/livibetter/6850443 | |
# Clip: https://www.youtube.com/watch?v=rKr8wjKuhBY | |
# | |
# References: |
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 binascii import hexlify, unhexlify | |
from hashlib import md5 | |
from Crypto.Cipher import AES | |
try: | |
from M2Crypto import EVP | |
except ImportError: | |
EVP = None | |
def m2_encrypt(plaintext, key, iv, key_as_bytes=False, padding=True): |
To increase speed of a video by a factor of 1.5x:
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=PTS/1.5[v];[0:a]atempo=1.5[a]" -map "[v]" -map "[a]" output.mp4
We can use this to adjust the speed of all the videos in a directory (Linux and macOS only):
mkdir -p output
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
#!/usr/bin/python | |
# | |
# Author: Patrick Bailey | |
# Twitter: @whiteboardoder | |
# | |
#The MIT License (MIT) | |
# | |
#Copyright (c) 2016 "whiteboardcoder" Patrick Bailey | |
# | |
#Permission is hereby granted, free of charge, to any person obtaining a copy |
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
import SimpleHTTPServer | |
import SocketServer | |
PORT = 8000 | |
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_POST(self): | |
content_len = int(self.headers.getheader('content-length', 0)) | |
post_body = self.rfile.read(content_len) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import requests | |
import sys | |
from Crypto.Cipher import AES | |
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
# -*- coding:utf-8 -*- | |
# | |
# Copyright (C) 2013 Carlos Jenkins <carlos@jenkins.co.cr> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
#!/usr/bin/perl -w | |
use strict; | |
use IO::Socket::INET; | |
use IO::Socket::SSL; | |
use Getopt::Long; | |
use Config; | |
$SIG{'PIPE'} = 'IGNORE'; #Ignore broken pipe errors | |
print <<EOTEXT; |
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
require 'strscan' | |
# expr := term | |
# | term AND expr | |
# | term OR expr | |
# term := value | |
# | atom ':' value | |
# atom := word+ | |
# | quoted_string | |
# value := atom |