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
| """Usage: | |
| pymodoro start <taskname> [--minutes=<minutes>] | |
| Options: | |
| --version Show program's version number and exit | |
| -h, --help Show this help message and exit | |
| """ | |
| import time | |
| import datetime |
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 urwid | |
| def on_exit_clicked(button): | |
| raise urwid.ExitMainLoop() | |
| def exit_on_q(key): | |
| if key.upper() == 'Q': | |
| raise urwid.ExitMainLoop() | |
| def task_question(): |
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 argparse | |
| parser = argparse.ArgumentParser(description='Prints stuff out') | |
| parser.add_argument("thingy") | |
| parser.add_argument("separator", nargs='?', default="") | |
| options = parser.parse_args() | |
| print(options.separator.join([x for x in options.thingy])) |
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 urwid | |
| def on_exit_clicked(button): | |
| raise urwid.ExitMainLoop() | |
| def exit_on_q(key): | |
| if key.upper() == 'Q': | |
| raise urwid.ExitMainLoop() | |
| def task_question(): |
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
| def command_live(self, rest): | |
| player = rest.partition(' ') | |
| if player: | |
| # find the player on lichess | |
| pass | |
| else: | |
| # show all channel members on lichess | |
| pass |
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 | |
| import urllib2 | |
| import json | |
| import collections | |
| from twisted.internet import defer, endpoints, protocol, reactor, task | |
| from twisted.python import log | |
| from twisted.words.protocols import irc | |
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 | |
| import unittest | |
| class ChessGame(object): | |
| fen_startpos = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" | |
| fen_test = "rnbqkb1r/1p2pppp/p2p1n2/8/3NP3/2N5/PPP2PPP/R1BQKB1R w KQkq -" | |
| def __init__(self): | |
| self.board = [["#"]*12 for i in range(12)] | |
| self.turn = "-" |
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
| execute pathogen#infect() | |
| syntax on | |
| filetype plugin indent on | |
| set ts=4 | |
| set sw=4 | |
| set sts=4 | |
| set textwidth=79 | |
| set expandtab | |
| set autoindent |
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 copy import deepcopy | |
| grid = [[0]*10 for x in range(8)] | |
| grid[4][4] = 1 | |
| grid[4][5] = 1 | |
| grid[4][6] = 1 | |
| def life_check(grid, x, y): |
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 unittest | |
| from gameoflife import life_check, run_mutations | |
| class GameofLifeTest(unittest.TestCase): | |
| def setUp(self): | |
| # Set up a grid with a blinker | |
| grid = [[0]*8 for x in range(8)] | |
| grid[4][4] = 1 |