- Code Craft: The Practice Of Writing Excellent Code
- Gray Hat Python: Python Programming For Hackers And Reverse Engineers
- Python For Kids: A Playful Introduction To Programming
- Black Hat Python: Python Programming For Hackers And Pentesters
- Automate The Boring Stuff With Python: Practical Programming For Total Beginners
- Python Playground: Geeky Projects For The Curious Programmer
- Teach Your Kids To Code: A Parent-friendly Guide To Python Programming
- Doing Math With Python: Use Programming To Explore Algebra, Statistics, Calculus, And More!
- Invent Your Own Computer Games With Python, 4e
- Cracking Codes With Python: An Introduction To Building And Breaking Ciphers
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
| reobj = re.compile(r"\b(((?#protocol)https?|ftp):?//|go/|(?#www)www[.]+)((?#domain)[-A-Z0-9.]+)((?#file)/[-A-Z0-9+&@#/%=~_|!:,.;]*)?((?#parameters)\?[A-Z0-9+&@#/%=~_|!:,.;]*)?", re.IGNORECASE) | |
| for match in reobj.finditer(subject): | |
| # match start: match.start() | |
| # match end (exclusive): match.end() | |
| # matched text: match.group() |
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 Crypto.Cipher import AES | |
| from Crypto.Random import get_random_bytes | |
| def on_str(): | |
| key = get_random_bytes(32) # Use a stored / generated key | |
| data_to_encrypt = 'This is plain text!' # This is your data | |
| print(key) | |
| print(data_to_encrypt) | |
| # === Encrypt === |
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 django.shortcuts import render | |
| from django.views.decorators.csrf import csrf_exempt | |
| from django.http import HttpResponse | |
| from django.views.generic import TemplateView | |
| import base64 | |
| class ReceiptView(TemplateView): | |
| """""" |
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
| let _assetLoader; | |
| class Assets { | |
| static loader(){ | |
| if(_assetLoader == undefined) { | |
| _assetLoader = assetLoader(this.document()) | |
| } |
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
| Virtualenv allows you to sandbox a python app. It’s easy on ubuntu. | |
| # install virtualenv app | |
| Sudo apt-get install virtualenv | |
| # make a new env to use. ‘env’ is the usual folder name I use. Brian uses somat different (“environ”?) | |
| virtualenv env | |
| # Use the env | |
| source env/bin/activate |
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
| # optional dependancies: | |
| # termcolor | |
| # log("content", color='red') | |
| import sys | |
| from termcolor import colored | |
| def log(*args, **kargs): | |
| colors = ( | |
| (bool, 'cyan'), |
NewerOlder