I hereby claim:
- I am arturtamborski on github.
- I am arturtamborski (https://keybase.io/arturtamborski) on keybase.
- I have a public key ASA-mGO46Ymooz8NRi3JSpG76wXMyqrLtEUfyLbQN_VuSQo
To claim this, I am signing this object:
from functools import wraps | |
from django.core.exceptions import ImproperlyConfigured, PermissionDenied | |
from django.shortcuts import get_object_or_404 | |
from django.conf import settings | |
OWNERSHIP_REQUIRED_CALLABLE = getattr(settings, 'OWNERSHIP_REQUIRED_CALLABLE', 'is_owner') | |
OWNERSHIP_REQUIRED_PASS_OBJ = getattr(settings, 'OWNERSHIP_REQUIRED_PASS_OBJ', True) |
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
git stash | |
git filter-branch --env-filter ' | |
an="$GIT_AUTHOR_NAME" | |
am="$GIT_AUTHOR_EMAIL" | |
cn="$GIT_COMMITTER_NAME" | |
cm="$GIT_COMMITTER_EMAIL" |
all: build # run all | |
echo "Done." | |
help: # not-too-nice help, but simple and works fine | |
@perl -ne '/^([A-Za-z0-9-_]+):.*#\s+(.*)/ && printf "$$1\t$$2\n"' makefile | |
pretty-help: # bit more advanced printing with constant alignment | |
@perl -ne '/^([A-Za-z0-9-_]+):.*#\s+(.*)/ && \ | |
printf "%*s%s\n", 10, $$1, $$2 ? " - $$2" : ""' makefile |
def convert_dol_to_lod(input_dict): | |
""" Convert dict of lists to list of dicts. | |
Each list under keys in `input_dict` | |
must have the same length. | |
Example: | |
input_dict = { | |
"name": ["vm1", "vm2", "vm3"], | |
"zone": [10001, 10002, 10003], | |
} |
#!/bin/bash | |
set -euf -o pipefail | |
terraforming help \ | |
| grep terraforming \ | |
| cut -f4 -d' ' \ | |
| grep -v help \ | |
| while read service | |
do | |
printf "\033[1m==> %s\033[0m\n" $service |
-------------------------------------------------------------------------------- | |
-- u_backlog -- | |
-------------------------------------------------------------------------------- | |
IF OBJECT_ID('dbo.u_backlog', 'U') IS NOT NULL | |
DROP TABLE dbo.u_backlog | |
GO | |
CREATE TABLE dbo.u_backlog ( | |
id BIGINT NOT NULL PRIMARY KEY IDENTITY, | |
uuid UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID(), |
def flatten(obj, depth=5, sep=","): | |
if depth < 0: | |
return "" | |
if type(obj) in [list, dict]: | |
values = getattr(obj, 'values', obj.__iter__)() | |
return sep.join(map(lambda x: flatten(x, depth-1), values)) | |
return str(obj) | |
>>> flatten({1:10, 2:20, 3:30, 4:40, 5:50, 6:[60, 70, 80, 90], '_':{'a':'A', 'b':'B', 'c':'C'}}) |
https://gjs-docs.gnome.org/ | |
https://wiki.gnome.org/Projects/GnomeShell/Extensions/Writing | |
https://wiki.gnome.org/Projects/GnomeShell/Extensions/StepByStepTutorial | |
https://www.roojs.com/seed/gir-1.2-gtk-3.0/gjs/index.html | |
for some reason that was harder to find than it should be... |
**/*.pyc | |
**/*.pyo | |
**/*.log | |
**/_pycache__ | |
docs/_build | |
**/.ipynb_checkpoints | |
.venv/ | |
.pytest_cache/ | |
.tox/ | |
**/*.egg-info |