I hereby claim:
- I am drdaeman on github.
- I am drdaeman (https://keybase.io/drdaeman) on keybase.
- I have a public key whose fingerprint is FE74 8B15 6F78 F2B3 360E 9C85 E1C3 A285 7EFC 7C66
To claim this, I am signing this object:
| """ | |
| A drop-in replacement to make PyBrowserID[1] | |
| use cryptography.io instead of M2Crypto. | |
| Replace browserid/crypto/fallback.py with this file, | |
| or monkey-patch browserid.crypto.{Key,RSKey,DSKey}, | |
| or whatever. The choice of dirtiness is up to you. | |
| Use with caution. I'm no cryptographer. |
I hereby claim:
To claim this, I am signing this object:
| from __future__ import absolute_import, unicode_literals | |
| from djmoney.models.fields import MoneyField, MoneyFieldProxy | |
| class CurrencyLockedMoneyFieldProxy(MoneyFieldProxy): | |
| def __init__(self, field, currency_field_name=None): | |
| super(CurrencyLockedMoneyFieldProxy, self).__init__(field) | |
| if currency_field_name is not None: | |
| self.currency_field_name = currency_field_name |
| const _ = require("lodash"); | |
| function inferTypeOf(value) { | |
| // Given a value from RethinkDB, tries to infer its ReQL type. | |
| // Returns a string value, similar to r.typeOf result, or an empty | |
| // string if the type is not recognized or unsupported. | |
| switch (typeof value) { | |
| case "string": | |
| return "STRING"; | |
| case "number": |
Just a heads up for those who are looking into running Docker containers natively on WSL. While it's not usable for anything serious (even your toy project development), there is a way.
Nuances:
--privileged, --net-host and no DNS.WSL doesn't have cgroups at the moment, and probably won't have them anytime soon, so no way Docker would work.
| import collections | |
| import itertools | |
| def get_result_models_lazy(results): | |
| """ | |
| Given a ``Response`` instance or any iterable with documents, | |
| provides an iterable (a generator, to be exact) with matching | |
| database model instances. | |
| FROM node:9 AS build-ui | |
| RUN npm install -g elm --unsafe-perm=true --allow-root | |
| COPY ./ui /app/ui | |
| RUN cd /app/ui \ | |
| && ([ ! -e elm-stuff ] || rm -rf elm-stuff) \ | |
| && elm-make --yes src/Main.elm --output=scripts/oklog.js | |
| # ============================================================================ |
| { config, pkgs, ... }: | |
| { | |
| # Kubernetes configuration | |
| # Insecure, for local development only, totally unsuitable for production | |
| services.kubernetes = { | |
| roles = ["master" "node"]; | |
| # Without explicitly defined keys things will break after reboot, | |
| # as by default keys will be generated in /var/run/kubernetes. |