- Python 3
- Pip 3
$ brew install python3| 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 |
| [{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375"," |
| h1. Sublime Text 2 - Useful Shortcuts (Mac OS X) | |
| h2. General | |
| | *⌘T* | go to file | | |
| | *⌘⌃P* | go to project | | |
| | *⌘R* | go to methods | | |
| | *⌃G* | go to line | | |
| | *⌘KB* | toggle side bar | | |
| | *⌘⇧P* | command prompt | |