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
| import re | |
| import webbrowser | |
| from tweet import gen_tweet | |
| from tweepy_api import get_api | |
| def last_rt(user, tweet_id): | |
| api = get_api() | |
| timeline = api.user_timeline(user, max_id=tweet_id, count=100) |
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
| import webbrowser | |
| from camel import Camel | |
| from dataclasses import dataclass | |
| from typing import List | |
| from tweet import Tweet, gen_tweet | |
| from camel_registry import reg | |
| from find_boops import find_boops |
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/env python3 | |
| # Do Riichi final scoring based on | |
| # http://arcturus.su/wiki/Oka_and_uma | |
| def placements(scores): | |
| """return array of relative placements in scores. | |
| 0 for the best score 1 for second best, etc. | |
| ties broken by order in scores |
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/env python3 | |
| from sys import argv, exit | |
| from os import path, remove, scandir, rename | |
| try: | |
| from bencodepy import decode_from_file | |
| except ImportError: | |
| exit('bencodepy is not installed.\n(hint: pip install bencodepy)') | |
| if len(argv) < 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
| #!/usr/bin/env python3 | |
| import os | |
| from os import path | |
| options = {debug:True, | |
| doit :True} | |
| def restructure(basepath): | |
| """given a basepath, restructure each folder within basepath. | |
| equilivant to the following lines of bash where out is basepath: |
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/node | |
| const PlexAPI = require('plex-api'); | |
| const credentials = require('plex-api-credentials'); | |
| const userAndPass = credentials({ | |
| username: 'username', | |
| password: 'hunter2' | |
| }); | |
| const client = new PlexAPI({ | |
| hostname: 'localhost', |
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
| import sys | |
| def replace_text(inpath, outpath, replacements): | |
| with open(outpath, 'w', encoding='utf-8') as outfile: | |
| for line in open(inpath, encoding='utf-8'): | |
| for key in replacements: | |
| val = replacements[key] | |
| line = line.replace('\\an{}'.format(key), '\\an{}'.format(val)) | |
| outfile.write(line) |
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/env python3 | |
| # split out AMAZON/NETFLIX STYLE TYPESETTING | |
| #by iamevn | |
| import sys, re | |
| def find_nth(string, substring, n, start=0): | |
| """find nth occurance of substring in string starting at position start. | |
| (uses string.find) n starts at 1, start starts at 0""" | |
| found = string.find(substring, start) | |
| if n == 1 or found == -1: |
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
| # Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. | |
| # Any live cell with two or three live neighbours lives on to the next generation. | |
| # Any live cell with more than three live neighbours dies, as if by overpopulation. | |
| # Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. | |
| # width and height define the world, it wraps around like a torus | |
| # clear screen by outputting \033c (27 99) | |
| # (0, 0) (top left) is in cell 0. (0, 1) is in cell 1. (1, 0) is in cell {width} | |
| # for a cell n in grid of width w and height h, its neighbors are: | |
| # {(n - w - 1), (n - w), (n - w + 1) |
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/env python3 | |
| # combine adjacent lines with the same timecodes | |
| import sys | |
| from datetime import datetime, timedelta | |
| def find_nth(string, substring, n, start=0): | |
| """find nth occurance of substring in string starting at position start. | |
| (uses string.find) n starts at 1, start starts at 0""" | |
| found = string.find(substring, start) |