The <leader>
key has been replaced with , from the original docs. The readme file this was pull from lives here:
| Motion Command | Description |
/* | |
* NOTE: | |
* - The use of browser-specific styles (-moz-, -webkit-) should be avoided. | |
* If used, they may not render correctly for people reading the email in | |
* a different browser than the one from which the email was sent. | |
* - The use of state-dependent styles (like a:hover) don't work because they | |
* don't match at the time the styles are made explicit. (In email, styles | |
* must be explicitly applied to all elements -- stylesheets get stripped.) | |
*/ |
The <leader>
key has been replaced with , from the original docs. The readme file this was pull from lives here:
| Motion Command | Description |
# ### | |
# damon.conf - IINA keybindings | |
# ### | |
# Copied from the default input config for IINA | |
# | |
# Documentation can be found here: | |
# * https://github.com/lhc70000/iina/wiki/Manage-Key-Bindings | |
# * https://mpv.io/manual/stable/#command-interface | |
#@iina Shift+Meta+v video-panel |
import contextlib | |
@contextlib.contextmanager | |
def managed_records(shelve_db_names, file_names): | |
try: | |
shelve_dbs = [] | |
for name in shelve_db_names: | |
db = shelve.open(name, protocol=pickle.HIGHEST_PROTOCOL) | |
shelve_dbs.append(db) |
.blob-code-inner, | |
.blob-num, | |
.highlight pre, | |
.files > tbody > tr > td.content a { | |
font-family: "Operator Mono" !important; | |
} | |
.files > tbody > tr > td.content a { | |
font-size: 13.3px; | |
} | |
.pl-c, .pl-e { |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
from __future__ import absolute_import, print_function, unicode_literals | |
from collections import namedtuple | |
import io | |
import re | |
# python 3 backport of the stdlib csv module | |
# https://github.com/ryanhiebert/backports.csv | |
from backports import csv |
def validate_data(self, data): | |
ret = OrderedDict() | |
errors = OrderedDict() | |
fields = self._writable_fields | |
for field in fields: | |
validate_method = getattr( | |
self, 'validate_' + field.field_name, None) | |
primitive_value = field.get_value(data) | |
try: |
def to_internal_value(self, data): | |
""" | |
Dict of native values <- Dict of primitive datatypes. | |
""" | |
if not isinstance(data, Mapping): | |
message = self.error_messages['invalid'].format( | |
datatype=type(data).__name__ | |
) | |
raise ValidationError({ | |
api_settings.NON_FIELD_ERRORS_KEY: [message] |
from __future__ import print_function, unicode_literals | |
from six import itertools | |
def batch(iterable, size): | |
""" Generates slices of items in groups of `size` length. | |
>>> for group in batch(range(10), size=4): | |
print(group) | |
(0, 1, 2, 3) |