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
| class AbstractClassError(Exception): | |
| pass | |
| class M(type): | |
| # staticmethod | |
| def __new__(cls, className, baseClasses, members, abstract): | |
| newClass = type.__new__(cls, className, baseClasses, members) | |
| if abstract: | |
| def newnew(cls, *_, **__): |
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
| class __Environment(): | |
| """ | |
| Create a Python root environment with local and global symbols and a builtins | |
| namespace | |
| """ | |
| globals: Dict #: global symbols | |
| locals: Dict #: local symbols | |
| builtins: Dict #: builtins namespace (``__builtins__``) |
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
| # GitHub user: https://github.com/mkropat | |
| # Gist account at GitHub: https://gist.github.com/mkropat | |
| # Gist snippet URL: https://gist.github.com/mkropat/c1226e0cc2ca941b23a9 | |
| function Add-EnvPath | |
| { param( | |
| [Parameter(Mandatory=$true)] | |
| [string] $Path, | |
| [ValidateSet("Machine", "User", "Session")] | |
| [string] $Container = "Session" |
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
| class SomeTestcases(TestCase): | |
| _continueTesting = True | |
| def setUp(self) -> None: | |
| """Check for every test, if tests should continue.""" | |
| if not self.__class__._continueTesting: | |
| self.skipTest("No reason to go on.") | |
| def fail(self, msg: Any = ...) -> NoReturn: | |
| self.__class__._continueTesting = False |
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
| urlencode() { | |
| # urlencode <string> | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:i:1}" | |
| case $c in | |
| [a-zA-Z0-9.~_-]) printf "$c" ;; |
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
| #Compress and copy via SSH using SCP and TAR | |
| tar -czf - /some/file | ssh joebloggs@otherserver.com tar -xzf - -C /destination | |
| #Switch -c for tar creates an archive and -f which tells tar to send the new archive to stdout. | |
| #The second tar command uses the -C switch which changes directory on the target host. It takes the input from stdin. The -x switch extracts the archive. | |
| #The second way of doing the transfer over a network is with the -z option, which compresses the stream, decreasing time it will take to transfer over the network. | |
| #Some people may ask why tar is used, this is great for large file trees, as it is just streaming the data from one host to another and not having to do intense operations with file trees. | |
| #If using the -v (verbose) switch, be sure only to include it on the second tar command, otherwise you will see double output. | |
| #Using tar and piping can also be a great way to transfer files locally to be sure that file permissions are kept correctly |
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
| The PoC-Library is licensed under the [Apache License 2.0][al20]. | |
| Due to the modular structure of the PoC-Library, contributions can come in two distinct forms: | |
| - **(1)** modifications of the core code (i.e., the code under the copyright of the | |
| Chair for VLSI Design, Diagnostics and Architecture, Faculty of Computer Science, | |
| Technische Universität Dresden, including extensions in the core repository) as well as | |
| - **(2)** **third party extensions**, translations and similar additions. | |
| Essentially, the difference between the two is that type **(1)** contributions cannot be |
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
| The Apache Software Foundation | |
| Individual Contributor License Agreement ("Agreement") V2.0 | |
| http://www.apache.org/licenses/ | |
| Thank you for your interest in The Apache Software Foundation (the | |
| "Foundation"). In order to clarify the intellectual property license | |
| granted with Contributions from any person or entity, the Foundation | |
| must have a Contributor License Agreement ("CLA") on file that has | |
| been signed by each Contributor, indicating agreement to the license | |
| terms below. This license is for your protection as a Contributor as |
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
| # Save this file as: C:\Users\<Username>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 | |
| $Executables = @{ | |
| 'Notepad++'="C:\Program Files (x86)\Notepad++\notepad++.exe" | |
| } | |
| Write-Host "--------------------------------------------------------------------------------" | |
| if (Test-Path $Executables['Notepad++']) | |
| { # function Edit |