Type | Item | CHF | chEUR |
---|---|---|---|
Case | [be quiet! Dark Base 700][1] | 165 | |
PSU | [be quiet! Straight Power 11 650W][2] | 110 | |
Board | [Asus ROG STRIX X470-F Gaming][3] | 235 | |
CPU | [AMD Ryzen 7 2700X][4] | 360 | |
Cooler | [Noctua NH-D15 SE-AM4][5] | 100 | |
GPU | [MSI RTX 2070 Gaming Z][6] | 700 |
This file contains hidden or 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
#!/bin/bash | |
prev_head=$1 | |
new_head=$2 | |
checkout_type=$3 | |
[[ $checkout_type == '1' ]] || exit 0 | |
[[ $prev_head == $new_head ]] && exit 0 | |
cd "./$(git rev-parse --show-cdup)" |
This file contains hidden or 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
def _index(self, name, tablename, columns, schema=None, **kw): | |
t = sa_schema.Table(tablename or 'no_table', sa_schema.MetaData(), | |
*[sa_schema.Column(n, NULLTYPE) for n in columns], | |
schema=schema | |
) | |
return sa_schema.Index(name, *[t.c[n] for n in columns], **kw) |
This file contains hidden or 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(object): | |
... def bar(self, blah): | |
... print self, blah | |
... | |
>>> Foo.bar | |
<unbound method Foo.bar> | |
>>> Foo.bar(None, 2) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: unbound method bar() must be called with Foo instance as first argument (got NoneType instance instead) |
This file contains hidden or 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
>>> from indico.modules.rb.models import Photo | |
>>> Photo.room | |
AttributeError: type object 'Photo' has no attribute 'room' | |
>>> db.session.query(Photo) | |
<sqlalchemy.orm.query.Query at 0x8211490> | |
>>> Photo.room | |
<sqlalchemy.orm.attributes.InstrumentedAttribute at 0x81c8090> |
This file contains hidden or 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 RestrictedEvalex(object): | |
def __init__(self, whitelist=None): | |
self.whitelist = whitelist | |
def __nonzero__(self): | |
if not self.whitelist: | |
return False | |
elif self.whitelist is True: | |
return True |
This file contains hidden or 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 _UnboundLocalizedField(UnboundField): | |
def __init__(self, field, locale): | |
super(_UnboundLocalizedField, self).__init__(field.field_class, *deepcopy(field.args), **deepcopy(field.kwargs)) | |
self.locale = locale | |
# Make the field optional if it's not the default locale | |
if locale != current_app.config['BABEL_DEFAULT_LOCALE']: | |
# Validators can be set via positional or keyword argument | |
if len(self.args) > 1: | |
self.args[1][:] = [x for x in self.args[1] if not isinstance(x, DataRequired)] | |
elif 'validators' in self.kwargs: |
This file contains hidden or 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
import logging | |
import os | |
import re | |
import sys | |
from errno import ENOENT, EINVAL | |
from stat import S_IFDIR, S_IFLNK | |
from fuse import FUSE, Operations, LoggingMixIn, FuseOSError | |
I hereby claim:
- I am thiefmaster on github.
- I am thiefmaster (https://keybase.io/thiefmaster) on keybase.
- I have a public key whose fingerprint is 6ED8 EE76 5B86 4EB7 5068 25F8 B071 CD13 184D 719C
To claim this, I am signing this object:
This file contains hidden or 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 UsedIf(object): | |
""" | |
Make a WTF field "used" if a given condition evaluates to True. | |
If the field is not used, validation stops. | |
""" | |
def __init__(self, condition): | |
self.condition = condition | |
def __call__(self, form, field): | |
if self.condition in (True, False): |