- Create or find a gist that you own.
- Clone your gist (replace
<hash>with your gist's hash):# with ssh git clone [email protected]:<hash>.git mygist # with https
git clone https://gist.github.com/.git mygist
| # This demonstrates how to use the secp256k1-zkp-mw Python module, https://github.com/grinventions/secp256k1-zkp-mw, to find all the unspent Grin outputs belonging to a wallet. This code lacks any error checking. A wallet's rewind hash can be obtained by running the command `grin-wallet rewind_hash` with the Grin CLI wallet, https://github.com/mimblewimble/grin-wallet. | |
| # Imports | |
| from secp256k1_zkp_mw import * | |
| from hashlib import blake2b | |
| import requests | |
| # Constants |
<hash> with your gist's hash):
# with ssh
git clone [email protected]:<hash>.git mygist
# with httpsgit clone https://gist.github.com/.git mygist
| # Assumes that "a" contains an integer > 2 whose primality needs to be verified | |
| # The algorithm builds a list of factors including the number 2 and all odd numbers | |
| # up to the square root of "a", and then checks if any of those numbers divides "a" | |
| # without a remainder - if so then "a" is not prime, else it is | |
| if sum([ True if a%factor == 0 else False for factor in ( [2] + list(range(3,int(math.sqrt(a))+1,2) )) ]): | |
| print("Number is composite") | |
| else: | |
| print("Number is prime") |
Jekyll-Scholar is for all the academic bloggers out there. It is a set of extensions to Jekyll, the awesome, blog aware, static site generator; it formats your bibliographies and reading lists for the web and gives your blog posts citation super-powers.
For additional features you may also want to take a look at jekyll-scholar-extras.
| '''List loaded modules and packages, and show their version numbers | |
| and/or Git repository's HEAD commit SHA. | |
| ''' | |
| # Standard library modules | |
| import types | |
| # Third-party packages | |
| import git # GitPython |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| ----- Esc ----- | |
| Quick change directory: Esc + c | |
| Quick change directory history: Esc + c and then Esc + h | |
| Quick change directory previous entry: Esc + c and then Esc + p | |
| Command line history: Esc + h | |
| Command line previous command: Esc + p | |
| View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
| Print current working directory in command line: Esc + a | |
| Switch between background command line and MC: Ctrl + o | |
| Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |