This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# current method | |
obj = session.query(Foo).get(id) # select * from foo where id=? | |
obj.bar = session.query(Bar).get(bar_id) # select * from bar where id=? | |
# what i want: | |
obj = session.query(Foo).get(id) # select * from foo where id=? | |
obj.bar = session.hollow(Bar, bar_id) # invented name, no query should happen until i use attributes of obj.bar | |
# what i want to avoid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1> stuff</h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this does not work since docs is not a factor | |
$ tox -e docs-html # will build html docs | |
$ tox -e docs-pdf # will build pdf docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: test | |
hosts: application | |
roles: | |
- {role: deployment, app: "{{applications[0]}}", } | |
- {role: deployment, app: "{{applications[1]}}", when: '{{applications|length > 1}}' } | |
- {role: deployment, app: "{{applications[2]}}", when: '{{applications|length > 2}}' } | |
- {role: deployment, app: "{{applications[3]}}", when: '{{applications|length > 3}}' } | |
- {role: deployment, app: "{{applications[4]}}", when: '{{applications|length > 4}}' } | |
- {role: deployment, app: "{{applications[5]}}", when: '{{applications|length > 5}}' } | |
- {role: deployment, app: "{{applications[6]}}", when: '{{applications|length > 6}}' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
let enabled = {enable = true;}; in | |
{ | |
boot.loader.grub = { | |
enable = true; | |
version = 2; | |
device = "/dev/sda"; | |
}; | |
security.sudo.wheelNeedsPassword = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
import ./enpass { | |
inherit (pkgs) dpkg patchelf openssl glib mesa libpulseaudio zlib dbus; | |
inherit stdenv fetchurl makeWrapper; | |
inherit (pkgs.xorg) libX11 libXext libXScrnSaver; | |
qt = pkgs.qt56; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class foo(Element) | |
exists = sentaku.ContextualMethod() | |
@exists.implemented_for(ViaDB) | |
def exists(self): | |
""" | |
Checks if the PXE server already exists | |
""" | |
return self.db.exists("pxe_servers", name=self.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tagged | |
class Maybe(object): | |
@construct | |
def Nothing(self): | |
pass | |
@construct | |
def Just(self, data: int): | |
pass | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# written in browser# | |
class ChangeProxy(object): | |
def __init__(self, observed, tracker): | |
self.__observed = observed | |
self.__tracker = tracker | |
def __getattr__(self, key): | |
if key in self.__tracker: | |
return self.__tracker[key] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ borg check -v --debug borg | |
using builtin fallback logging configuration | |
29 self tests completed in 0.12 seconds | |
Starting repository check | |
Index object count mismatch. 3379815 != 3379816 | |
Completed repository check, errors found. |