This gist is part of a blog post. Check it out at:
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
defmodule Acme.Repo do | |
use Ecto.Repo, | |
otp_app: :acme, | |
adapter: Ecto.Adapters.Postgres | |
def with_prefix(prefix) do | |
module_atom = Module.concat([Acme, Repo, WithPrefix, Macro.camelize(prefix)]) | |
# We could not find a better way to see if this module already existed | |
if !Kernel.function_exported?(module_atom, :prefix, 0) do |
class TenantAwareManager(Manager): | |
def get_queryset(self): | |
tenant_id = current_tenant_id() | |
# If the manager was built from a queryset using | |
# SomeQuerySet.as_manager() or SomeManager.from_queryset(), | |
# we want to use that queryset instead of TenantAwareQuerySet. | |
if self._queryset_class != QuerySet: | |
return super().get_queryset().filter(tenant__id=tenant_id) |
@contextmanager | |
def tenant(value): | |
""" | |
Context manager for tenants. Used to set and cleanup tennant. | |
param, value, can be Tenant object or id. | |
Using the context context manager | |
```python | |
with tenant(1): | |
Profile.objects.get(pk=1) |
Modern web-backed, “cloud software” has become ubiquitous, but has several fundamental usability issues that the authors believe can be solved by turning towards “local-first software”. Local-First means the software will work offline, but unlike old fashioned file-based software, LFS must support synchronizing work between collaborators. This requires LFS to implement some form of conflict resolution. This is a vision paper, proposing a new area of study, but they describe several working prototypes of the idea including a pixel art editor and a Trello clone.
Cloud software allows its users to collaborate in real time, access their data across all their devices, and takes backup out of the user’s hands. This feature set, particularly collaboration, is so important that it has led to the rapid adoption of cloud software. However, there are some significant drawbacks. By introducing the network cloud software is slower than local software. It also won’t work without a stable internet connection. The data live
Current count: <%= @click.count %> |
#! python3 | |
import requests | |
import sys | |
# replace these with configData | |
tableauServer = 'http://localhost/' | |
tableauUsername = 'Robin' | |
workbookView = 'WorldIndicators/GDPpercapita' | |
workbookView2 = 'WorldIndicators/Countryranks' | |
worksheetSuffix = '.csv' |