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/bash | |
| for set in *.json; do | |
| echo "$set ..." >&2 | |
| # unix2dos converts line endings for the sake of Windows-based concordancers | |
| # it's in the dos2unix package (named for the opposite tool) | |
| cat $set | ./mtgcorpus.py | unix2dos > $(basename $set .json).txt | |
| done | |
| echo "done" >&2 |
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
| [finnre@ruby ~]$ python quine.py | |
| File "quine.py", line 1 | |
| File "quine.py", line 1 | |
| ^ | |
| IndentationError: unexpected indent |
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
| #!/usr/bin/python3 | |
| import json | |
| print("Loading ... ", end="") | |
| with open("AllCards-x.json") as f: | |
| # that's http://mtgjson.com/json/AllSets-x.json.zip, unzipped | |
| cards = json.loads(f.read()) | |
| print("found {} cards.".format(len(cards))) |
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/bash | |
| # <CONFIG> | |
| # set to non-null to allow any user to read your dailies | |
| # if you don't set this or daily_group, only you can read your dailies | |
| public_dailies= | |
| # set to a group name to allow that group to read your dailies | |
| # (this is ignored if public_dailies is set) |
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
| Copyright 2017 Finn Ellis | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
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
| degrees = {0: "no", 2:"a little", 5:"some", 8:"quite a bit of", 11:"way too much"} | |
| def degree(d): | |
| for threshold, descriptor in sorted(degrees.items(), key=lambda x: x[0]): | |
| if d <= threshold: | |
| return descriptor | |
| return degrees[max(degrees.keys())] | |
| for x in range(15): | |
| print("{0}\tI ate {1} candy.".format(x, degree(x))) |
This script adds two commands to your shell:
show-waiting-prslists PRs awaiting review in the specified repository. It'll format them into a nice table (but not truncate any information, so it might be wider than your terminal). Example:show-waiting-prs relsqui/oobashall-waiting-prsdoes that for every repo with the specified owner, formatting the result into one uniform table that might truncate usernames or PR titles to fit your terminal, but never URLs. Example:all-waiting-prs relsqui- Add a second argument to filter by a repository tag:
all-waiting-prs relsqui game
- Add a second argument to filter by a repository tag:
- Install and configure the GitHub CLI
OlderNewer