This file contains 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
export JIRA_USERNAME="JIRA_EMAIL"; | |
export JIRA_API_KEY="API_KEY"; # Get key at https://id.atlassian.com/manage-profile/security | |
export JIRA_DOMAIN="example.atlassian.net" | |
export JIRA_PROJECT="PROJECT" | |
function j() { | |
git add .; | |
git stash; | |
local ticket_id="$JIRA_PROJECT-$1" | |
if ! git checkout -b $ticket_id 2>/dev/null; then |
This file contains 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
""" | |
Set a cron job to run this script every 5 minutes | |
It will download the image from the given URL and render it. | |
The ETag header is used to check if the image has changed. | |
If it has, the image is downloaded and rendered. | |
If not, the script exits early. | |
The ETag is saved to a file and checked on the next run. | |
Requires pimoroni/inky library: https://github.com/pimoroni/inky#installation |
This file contains 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
rest: | |
- resource: https://api.sls.blinkfitness.com/moso-api/activities/whoischeckedin?facilityId=FIND_THIS_ON_GYM_PAGE_getPriceByFacilityId_REQUEST_IN_WEB_INSPECTOR | |
scan_interval: 300 | |
headers: | |
Accept: '*/*' | |
Sec-Fetch-Site: same-site | |
Accept-Encoding: gzip, deflate, br | |
Sec-Fetch-Mode: cors | |
Accept-Language: en-US,en;q=0.9 | |
Origin: https://locations.blinkfitness.com |
This file contains 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
# This script allows the MatrixPortal M4 to switch between: | |
# 1. readonly mode: write to drive when connected to computer over USB C (Down button) | |
# 2. write mode: CircuitPython can write to itself (Up button) | |
# Useful when developing code to pair Wifi networks. | |
# Think of "down" button as developer mode (code cannot write to file system) | |
# and "up" button as production: (code can write to file system) | |
# | |
# After hitting "reset" button twice, or reconnecting USB-C cable: | |
# neopixel will flash orange three times, then teal when accepting up/down button press | |
# blue indicates readonly mode |
This file contains 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 re | |
words_to_digits = { | |
'zero': 0, | |
'one': 1, | |
'two': 2, | |
'three': 3, | |
'four': 4, | |
'five': 5, |
This file contains 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 boto3 | |
from base64 import b64decode | |
from urlparse import parse_qs | |
import logging | |
import urllib2 | |
import json | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) |
This file contains 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
class DataRequiredIf(wtforms.validators.DataRequired): | |
""" | |
Similar to DataRequired | |
Only evaluates if func(form.data) evaluates to True | |
""" | |
def __init__(self, func, *args, **kwargs): | |
super(DataRequiredIf, self).__init__(*args, **kwargs) | |
self.func = func | |
def __call__(self, form, field): |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
<style type="text/css"> | |
html, body, #map { | |
margin: 0; | |
padding: 0; |
This file contains 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 datetime | |
import time | |
from functools import wraps | |
from wsgiref.handlers import format_date_time | |
from flask import make_response | |
def cache(expires=None, round_to_minute=False): | |
""" | |
Add Flask cache response headers based on expires in seconds. |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Stupid Map</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" /> | |
<!--[if lte IE 8]> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.ie.css" /> | |
<![endif]--> | |
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script> | |
<style type="text/css"> |
NewerOlder