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
""" | |
iseq.py - A script for comparing the speed of is, ==, and neither with boolean values | |
csm10495 - Charles Machalow - MIT License | |
Hint: Usually == is slowest. Neither is fastest | |
""" | |
import timeit | |
def testN(n=1000): | |
""" |
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
""" | |
bdm241.py - Bomb Defusal Manual Version 1. Verification Code 241. | |
This file contains functions to solve various challenges faster than using the guide for 'Keep Talking and Nobody Explodes' | |
(C) - Charles Machalow - MIT License | |
""" | |
import itertools | |
words = ["about", "after", "again", "below", "could", "every", "first", "found", "great", "house", "large", "learn", "never", "other", "place", "plant", "point", "right", "small", "sound", "spell", "still", "study", "their", "there", "these", "thing", "think", "three", "water", "where", "which", "world", "would", "write"] | |
morse_seqs = { |
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
""" | |
Brief: | |
This file can be used to convert C++ enum code into a function to get a std::string from enum value. | |
To use: Copy and paste the entire enum code (from MSDN) as input to the script. | |
Output goes to an 'out.txt' file. | |
Author: | |
Charles Machalow | |
""" | |
lowCaseFirstLetter = lambda s: s[:1].lower() + s[1:] if s else '' |
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
""" | |
Brief: | |
This file can be used to make a ctypes Structure from a c++ struct. | |
Simply copy-paste the structure from typedef to end as input and | |
out.txt will be created with it as a Structure | |
You may need to make some type fixes... | |
Author: | |
Charles Machalow | |
""" |
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
""" | |
Brief: | |
This file can be used to make a Python dict from a c++ enum. | |
Simply copy-paste the enum from typedef to end as input and | |
out.txt will be created with it as a Python dict. | |
Author: | |
Charles Machalow | |
""" |
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
''' | |
Brief: | |
This searchs a directory recursively (by default the current directory) for a given regex match. The total number of matches is counted and printed at the end. | |
By default, it looks for lines where the author tag is given but there is no name provided. | |
Author(s): | |
Charles Machalow | |
''' | |
import os, re | |
REGEX = re.compile(r".*Author.*:\n(?:\s*|\s*\'\'\'\s*|\s*\"\"\"\s*)\n") | |
MAX_FILE_SIZE = 1024 * 128 #128 KB |
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
''' | |
Brief: | |
This script demonstrates how to get the current stack frame in a way faster than using | |
inspect.stack()... which is really slow (like ~450 times slower than this solution in most cases) | |
If the fast solution won't work, will fall back to an inspect.stack() solution. | |
Author: | |
Charles Machalow | |
''' |
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
DESCRIPTION=\ | |
''' | |
Brief: | |
ubuntuSetup.py - A script to setup an Ubuntu-family system to the way I like it. | |
Tested on Ubuntu 16.04 LTS. Should work on Ubuntu 14.04 LTS. | |
Enabled on Debian but not tested at all... may work, may not. | |
Description: | |
Some of the things this installs and configures: | |
- VS Code |
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
""" | |
Brief: | |
This script makes a self-extracting .py/,exe of a given folder | |
Author: | |
Charles Machalow | |
""" | |
import argparse | |
import base64 | |
import os |
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
''' | |
Brief: | |
snb.py - Removes the red border Skype makes when screensharing. | |
Also sets Skype to low priority with a processor affinity to only run on one cpu/core. | |
This should help keep game/other app performance decent. | |
Description: | |
Run the script once when the border is up, and it will go away | |
(C) - MIT License - 2017 | |
OlderNewer