Skip to content

Instantly share code, notes, and snippets.

View dlederle's full-sized avatar
🤦‍♂️
👨‍💻

Dylan Lederle-Ensign dlederle

🤦‍♂️
👨‍💻
View GitHub Profile
@dlederle
dlederle / tableau truseted
Created March 22, 2022 15:15 — forked from r-wheeler/tableau truseted
tableau trusted python
#! python3
import requests
import sys
# replace these with configData
tableauServer = 'http://localhost/'
tableauUsername = 'Robin'
workbookView = 'WorldIndicators/GDPpercapita'
workbookView2 = 'WorldIndicators/Countryranks'
worksheetSuffix = '.csv'
@dlederle
dlederle / _count.html.erb
Last active December 6, 2021 20:39
hotwire clicker (`rails g resource Click count:integer`)
Current count: <%= @click.count %>

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

@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)
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)
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
@dlederle
dlederle / .eslintrc.js
Created July 20, 2017 15:20 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@dlederle
dlederle / about.md
Created September 10, 2011 14:17 — forked from fogus/about.md
Programming Achievements: How to Level Up as a Developer

Programming Achievements: How to Level Up as a Developer

This gist is part of a blog post. Check it out at: