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
vertical layout > flex layout > flex autoscrolly |
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 django.http.response import (Http404, HttpResponseNotModified, | |
CompatibleStreamingHttpResponse) | |
from django.utils.http import http_date | |
from django.views.static import was_modified_since | |
from gridfs import GridFS | |
from mongoengine.connection import get_db | |
from bson.objectid import ObjectId | |
def file(request, collection_name, grid_id): |
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
PS1="« \[\e[1;32m\]\u@\h \[\e[1;34m\]\w\[\e[0m\] »\n\[\e[0;37m\]$\[\e[0m\] " |
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
conky.config = { | |
alignment = 'tl', | |
background = true, | |
border_width = 1, | |
default_bar_width = 256, default_bar_height = 4, | |
default_color = 'white', | |
default_outline_color = 'white', | |
default_shade_color = 'black', | |
double_buffer = true, | |
draw_borders = false, |
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
fs.inotify.max_user_watches=100000 |
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 CharacterName(EmbeddedDocument): | |
first = StringField() | |
last = StringField() | |
class Character(Document): | |
name = EmbeddedDocumentField(CharacterName) | |
rating = IntField() |
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
lst = [] | |
def foo1(bar=lst): | |
bar.append(1) | |
print(bar) | |
foo1() | |
foo1() | |
foo1() |
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
# Use uswsusp | |
SLEEP_MODULE="uswsusp" | |
# Always use suspend_hybrid instead of suspend | |
if [ "$METHOD" = "suspend" ]; then | |
METHOD=suspend_hybrid | |
fi |
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
a = ['123', '1234', None, '12'] | |
## 1 | |
from operator import methodcaller | |
b = [methodcaller('__len__')(x) for x in a if x] | |
print(b) | |
## 2 | |
b = [len(x) for x in a if x] | |
print(b) |
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
filename = os.path.join(root, name) | |
try: | |
os.remove(filename) | |
except OSError: | |
log.error('Error removing file %s' % filename) |