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
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
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
| # Based on reading : http://stackoverflow.com/questions/7936572/python-call-a-function-from-string-name | |
| # http://stackoverflow.com/questions/3061/calling-a-function-of-a-module-from-a-string-with-the-functions-name-in-python | |
| class Foo(object): | |
| def dynamic_call(self, attribute_name): | |
| method_name = 'calculate_' + attribute_name # e.g. given attribute name "baz" call method "calculate_baz" | |
| func = getattr(self, method_name) # find method that located within the class | |
| func() # execute the method |
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
| # Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |' | |
| # noinspection PyPep8 | |
| # noinspection PyPep8Naming | |
| # noinspection PyTypeChecker | |
| # noinspection PyAbstractClass | |
| # noinspection PyArgumentEqualDefault | |
| # noinspection PyArgumentList | |
| # noinspection PyAssignmentToLoopOrWithParameter | |
| # noinspection PyAttributeOutsideInit |
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
| """ | |
| Truncate a string (first argument) if it is longer than the given maximum string length (second argument). | |
| Return the truncated string with a ... ending. | |
| Note that inserting the three dots to the end will add to the string length. | |
| However, if the given maximum string length num is less than or equal to 3, | |
| then the addition of the three dots does not add to the string length in determining the truncated string. | |
| """ | |
| def truncate(string, num): |
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
| >Create FILE in #C:\Program Files (x86)\WinRAR#: | |
| rarreg.key | |
| >CONTENT: | |
| RAR registration data | |
| Full Trial | |
| Unlimited Company License | |
| UID=b8ecdb2e55d9ba48a249 | |
| 6412212250a24972f855bed69079b5ff75451ef6e808bf3853c16b | |
| fd6364209fe0f44cb41c60fce6cb5ffde62890079861be57638717 |
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
| """ | |
| This gist shows how to run asyncio loop in a separate thread. | |
| It could be useful if you want to mix sync and async code together. | |
| Python 3.7+ | |
| """ | |
| import asyncio | |
| from datetime import datetime | |
| from threading import Thread | |
| from typing import Tuple, List, Iterable |
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
| # this file contains keys needed for decryption of file system data (WUD/WUX) | |
| # 1 key per line, any text after a '#' character is considered a comment | |
| # the emulator will automatically pick the right key | |
| 541b9889519b27d363cd21604b97c67a # example key (can be deleted) | |
| d7b00402659ba2abd2cb0db27fa2b656 # Common | |
| 805e6285cd487de0faffaa65a6985e17 # Espresso Ancast | |
| b5d8ab06ed7f6cfc529f2ce1b4ea32fd # Starbuck Ancast | |
| 9a164ee15ac7ceb64d3cc130094095f6 # 007 Legends [EUR, NUS] |
Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.
The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).
| Style | Input | Output (12-hour clock) | Output (24-hour clock) |
|---|---|---|---|
| Default | <t:1543392060> |
November 28, 2018 9:01 AM | 28 November 2018 09:01 |
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 | |
| # Install git-filter-repo, as suggested by git docs: https://git-scm.com/docs/git-filter-branch#_warning | |
| git filter-repo --commit-callback ' | |
| old_email = b"[email protected]" | |
| correct_name = b"Your Correct Name" | |
| correct_email = b"[email protected]" | |
| if commit.committer_email == old_email : |
OlderNewer