- Python 3
- Pip 3
$ brew install python3| -- Get the name of the frontmost application | |
| tell application "System Events" | |
| set frontApp to name of first application process whose frontmost is true | |
| end tell | |
| -- Only proceed if the frontmost application is "Bike" | |
| if frontApp is "Bike" then | |
| set timeName to do shell script "date +'%H:%M'" | |
| tell application "Bike" |
| import datetime | |
| import os | |
| import re | |
| CRAFT_FOLDER = "craft" | |
| JOURNALS_PATH = CRAFT_FOLDER + '/journals' | |
| PAGES_PATH = CRAFT_FOLDER + '/pages' | |
| def fix_content(): |
| from django import forms | |
| from django.contrib.postgres.fields import ArrayField | |
| class ChoiceArrayField(ArrayField): | |
| """ | |
| A field that allows us to store an array of choices. | |
| Uses Django 1.9's postgres ArrayField | |
| and a MultipleChoiceField for its formfield. |
| # Copyright (C) 2016 Martina Pugliese | |
| from boto3 import resource | |
| from boto3.dynamodb.conditions import Key | |
| # The boto3 dynamoDB resource | |
| dynamodb_resource = resource('dynamodb') | |
| def get_table_metadata(table_name): |
| { | |
| "USD": { | |
| "symbol": "$", | |
| "name": "US Dollar", | |
| "symbol_native": "$", | |
| "decimal_digits": 2, | |
| "rounding": 0, | |
| "code": "USD", | |
| "name_plural": "US dollars" | |
| }, |
| #!/usr/bin/python | |
| import os | |
| import sys | |
| import boto3 | |
| # get an access token, local (from) directory, and S3 (to) directory | |
| # from the command-line | |
| local_directory, bucket, destination = sys.argv[1:4] |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Whoosh backend for haystack that implements character folding, as per http://packages.python.org/Whoosh/stemming.html#character-folding . | |
| To use, put this file on your path and add it to your haystack settings, eg. | |
| HAYSTACK_CONNECTIONS = { |
| class Node : | |
| def __init__( self, data ) : | |
| self.data = data | |
| self.next = None | |
| self.prev = None | |
| class LinkedList : | |
| def __init__( self ) : | |
| self.head = None |