View gri.py
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
import gridfs | |
import pymongo | |
conn = pymongo.MongoClient("mongodb://localhost:27017") | |
db = conn.test | |
videos_meta = db.videos_meta | |
def main(): | |
grid = gridfs.GridFS(db, "videos") |
View griget.py
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
import gridfs | |
import pymongo | |
conn = pymongo.MongoClient("mongodb://localhost:27017") | |
db = conn.test | |
videos_meta = db.videos_meta | |
def main(): | |
grid_id = videos_meta.find_one({"filename": "video.mp4"})["grid_id"] |
View a.py
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
def get_running_os_name(name): | |
os_map = { | |
"linux": "linux", | |
"freebsd": "freebsd", | |
"openbsd": "openbsd", | |
"sunos5": "solaris", | |
"win32": "windows", | |
"darwin": "osx"} | |
for start in os_map: |
View decorators.py
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
from datetime import datetime | |
DEBUG = True | |
TIMER = True | |
def logger(func): | |
import sys | |
def inner(*args, **kwargs): | |
sys.stdout.write("[{}] Calling FNAME with args: {} | kwargs: {}\n".format(datetime.now(), | |
args, |
View screensaver.py
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
import sys | |
import curses | |
import time | |
from collections import namedtuple | |
class App(object): | |
def __init__(self): | |
self.screen = curses.initscr() | |
self.screen.nodelay(True) |
View <i>.py
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
import sys | |
import curses | |
from curses import KEY_ENTER | |
import time | |
from collections import namedtuple | |
KEY = "KEY" | |
K_A = ord("a") | |
K_D = ord("d") |
View 234
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
─most@HPC ~ | |
╰─$ inxi -v 7 -c 18 |grep -4 Graphics | |
Machine: Mobo: ASUSTeK model: UX32VD v: 1.0 Bios: American Megatrends v: UX32VD.212 date: 09/17/2012 | |
CPU: Dual core Intel Core i7-3517U (-HT-MCP-) cache: 4096 KB | |
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9578 | |
Clock Speeds: 1: 1800 MHz 2: 1800 MHz 3: 1800 MHz 4: 1800 MHz | |
Graphics: Card-1: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0 chip-ID: 8086:0166 | |
Card-2: NVIDIA GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] | |
bus-ID: 01:00.0 chip-ID: 10de:1140 | |
Display Server: X.Org 1.15.99.903 driver: intel Resolution: 1920x1080@60.0hz |
View bad_duck.py
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
from abc import ABCMeta, abstractmethod | |
class Duck(object, metaclass=ABCMeta): | |
def quack(self): | |
print("Quack") | |
def swim(self): | |
print("I'm swimming!") |
View lol.py
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
>>> def timer(t, cb): | |
... time.sleep(t) | |
... cb() | |
... | |
>>> import time | |
>>> def foo(): | |
... print("Я проснулася!") | |
>>> th = threading.Thread(name='th1', target=timer, args=(5, foo)) |
View .Xresources
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
xterm*font: -*-terminus-medium-*-*-*-16-*-iso10646-* | |
xterm*wideFont: -misc-fixed-medium-r-normal-ja-16-120-75-75-c-120-iso10646-1 | |
UXTerm.font: xft:Terminus:pixelsize=14,xft:Kochi Mono | |
!! Molokai Theme | |
*xterm*background: #101010 | |
*xterm*foreground: #d0d0d0 | |
*xterm*cursorColor: #d0d0d0 |
OlderNewer