This file contains hidden or 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 | |
| StartDir=$(pwd) | |
| ScriptName=$(realpath "$0") | |
| ScriptDir=$(dirname "$ScriptName") | |
| if ! [ -d "$ScriptDir/youtube-dl" ] ; then | |
| echo "Downloading youtube-dl to $ScriptDir" | |
| cd "$ScriptDir" | |
| if ! git clone https://github.com/ytdl-org/youtube-dl.git ; then |
This file contains hidden or 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 six.moves.tkinter import ( | |
| Tk, | |
| Checkbutton, | |
| BooleanVar, | |
| ) | |
| from time import ( | |
| sleep, | |
| ) | |
| from win32api import ( | |
| PostMessage, |
This file contains hidden or 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/sh | |
| #\ | |
| exec wish "$0" "$@" | |
| wm title . "sha1sum front-end" | |
| for {set i 0} {$i < $argc} {incr i} { | |
| set file [lindex $argv $i] | |
| # label ".lab$i" -text "Computing SHA1 of $file..." | |
| global "var$i" |
This file contains hidden or 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
| __all__ = [ | |
| "LocalsCatcher" | |
| ] | |
| from sys import ( | |
| _getframe | |
| ) | |
| class LocalsCatcher(object): |
This file contains hidden or 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 random import choice | |
| # https://www.youtube.com/watch?v=HzbObZRCy9U | |
| cards = [(True, True), (False, False), (True, False)] | |
| N = 100000 | |
| matches = 0 | |
| for _ in range(N): |
This file contains hidden or 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
| def cast(v): | |
| if isinstance(v, bitmap): | |
| return v.i | |
| else: | |
| return v | |
| class bitmap(object): | |
| __slots__ = ("i",) | |
| def __init__(self, i = 0): |