MicroPython version for the Mäxchen game.
Requirements:
- Pyboard
- lcd160cr
#!/usr/bin/env bash | |
previous_module='' | |
previous_filepath='' | |
previous_prefix='' | |
status_code="0" | |
for filepath in $(git ls-files -- $(find . -type f -regex '.*\migrations.*\.py$')); do | |
module=${filepath%%/*} | |
if [ "$previous_module" != "$module" ]; then |
from flask import Flask, url_for, session, request, redirect | |
import os | |
from cube.app import app, AuthToken | |
from cube.api import get_twitter_api | |
import twython | |
import time | |
api = get_twitter_api() |
import os | |
from requests_oauthlib import OAuth1Session | |
request_token_url = 'https://api.twitter.com/oauth/request_token' | |
base_authorization_url = 'https://api.twitter.com/oauth/authorize' | |
access_token_url = 'https://api.twitter.com/oauth/access_token' | |
oauth = OAuth1Session(os.getenv('CONSUMER_KEY'), client_secret=os.getenv('CONSUMER_SECRET')) |
curl -u your_user:your_personal_token 'https://api.github.com/repos/OwnerHereAttentionItISSensitiveCase/repo-name/issues?labels=flaky-test&state=all' > flaky-tests.json | |
# it requires the `repo` permission. you can generate your token here: https://github.com/settings/tokens - needed if you have 2FA enabled |
git for-each-ref | |
--sort=-committerdate refs/heads/ | |
--format='git branch -D %(color:yellow)%(refname:short)%(color:reset) # (%(color:green)%(committerdate:relative)%(color:reset))' |
import random | |
def choose_action(): | |
actions = [ | |
"It's time to drink water!", | |
"Have you stretched on the last hour?", | |
"You should walk around a bit", | |
] | |
return random.choice(actions) |
class PrivateClassesView: | |
def post(self): | |
# code omitted for readability sake | |
data = { | |
'to': ['[email protected]'], | |
'body': 'blablabla', | |
'scheduled_for': datetime(2019, 3, 30, 11, 1, 0) | |
} | |
if subject: | |
data['subject'] = subject |
# stolen from https://stackoverflow.com/questions/20944483/python-3-sort-a-dict-by-its-values | |
[(k, d[k]) for k in sorted(d, key=d.get, reverse=True)] |
from pathlib import Path | |
import pytest | |
@pytest.fixture | |
def file_factory(tmpdir): | |
def _file_factory(path): | |
full_path = Path(path) | |
file_name = full_path.name |
MicroPython version for the Mäxchen game.
Requirements: