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 __init__(self, initlist=None): | |
self.data = [] | |
if initlist is not None: | |
# XXX should this accept an arbitrary sequence? | |
if type(initlist) == type(self.data): | |
self.data[:] = initlist | |
elif isinstance(initlist, UserList): | |
self.data[:] = initlist.data[:] | |
else: | |
self.data = list(initlist) |
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
upstream node { | |
server 0.0.0.0:3000; | |
} | |
upstream django { | |
server 0.0.0.0:8000 max_fails=1 fail_timeout=20s; | |
} | |
server { | |
server_name meddia.dataroot.co; |
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
Обновления до django 1.10 / python3.5~6 | |
Обновление библиотек pip, npm | |
Добавить поддержку http2.0, если нет, то шардинг статики (nginx и тд) | |
Рефакторинг всего, там много нерационального использования чего либо | |
Оптимизация запросов в db | |
Добавить кеш (cachalot + redis) | |
Переписать адекватно nginx.conf (добавить сжатие и выкосить что то) | |
Оптимизировать процессы IO (celery) | |
Продокументировать основные моменты(апи, деплой, вьюхи, модели) | |
Оптимизировать структуру бд и обновить до плюшек django 1.10 (fields postgres) |
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
@admin.register(LogPsy) | |
class DefaultAdmin(admin.ModelAdmin): | |
list_display = ('id', 'date', 'anonymous_id', 'psy') | |
def psy(self, obj): | |
template = "<div style='border-bottom: 1px solid #ececec'>" \ | |
" <b>%s</b>" \ | |
" <span style='float: right'>%s%</span><br/>" \ | |
"</div>" | |
to_percent = lambda x: int(round(100 * x)) |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMT6a0mwISC1lfvfAXtfwc45UZKnT6RKiFcj+0cO9sGh8zOB5LZLc5HVzRMZMXx5Xvn7V+4ehIGzos2bFn6mx8XDW6Ikt0BC2wRY5OZQZ8+H+zxkUUx2B2LysbSye8jaER6h2MNfqn0QuDRlC0/8pp/1av0BX9U9S8ZQv7Kkmq7V3r3B/PySH2Af2oNNUMd0gjY1zilQUwNt62L45RZKHpY4N9PY1IRsZYHFj67uxttejhgGXIno4W5PY7GrhZ4ks4TzKzlhTAxIv48A9IgpAikt5C6eNzhilevDNsCZSj4pWDxrvRSQDlNJR/VZRY/hWk4O00wek2ieM/4fk5l6JV misha@misha |
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
https://www.google.com/accounts/AccountChooser?Email=olexander.kozlov@dataroot.co&continue=https://apps.google.com/user/hub |
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 Promise from 'bluebird'; | |
export default function fetchComponentsData(dispatch, components, query, params) { | |
const promises = components | |
.filter(current => current) | |
.map(current => { | |
const component = current.WrappedComponent ? current.WrappedComponent : current; | |
return component.fetchData | |
? component.fetchData(dispatch, params, query, params.prefix) |
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 'babel-polyfill'; | |
import path from 'path'; | |
import express from 'express'; | |
import cookieParser from 'cookie-parser'; | |
import bodyParser from 'body-parser'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom/server'; | |
import { match, RouterContext } from 'react-router'; | |
import { Provider } from 'react-redux'; | |
import PrettyError from 'pretty-error'; |
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='main'] | |
.some-class | |
font-size: 12px |
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 fetch from 'isomorphic-fetch'; | |
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment'; | |
const port = 8000; | |
const host = canUseDOM ? '': `http://0.0.0.0:${port}`; | |
export default function customFetch(url, options, action) { | |
return fetch(host + url, options); | |
} |