Skip to content

Instantly share code, notes, and snippets.

Kirill Klenov klen

Block or report user

Report or block klen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View __init__.py
"""Provide information about opportunities."""
from collections import OrderedDict
import datetime as dt
import json
from flask import request
from flask_restler import route
from flask_restler.peewee import Filter, ModelFilters
from peewee import PostgresqlDatabase, SQL, Clause
View app.js
/*global window */
'use strict';
require('utils/preload');
require('utils/legacy');
var Backbone = require('backbone');
var app = require('objects/app.js');
var bqueue = require('objects/blanks-queue');
var conf = require('utils/conf');
View request.py
from aiohttp import CIMultiDict
# ... somewhere ...
request._headers = CIMultiDict(MY_CUSTOM_HEADER='VALUE HERE', MY_OTHER_CUSTOM_HEADER='VALUE HERE', **request.headers)
View gist:7eb5a41147718aedd3c9
[hekad]
base_dir = "/var/cache/hekad"
pid_file = "/var/run/hekad.pid"
maxprocs = 1
[UdpInput]
address = ":2003"
splitter = "TokenSplitter"
decoder = "StatsToFieldsDecoder"
View gist:dfff57ae592d457c3609
{u'created_at': u'2014-12-12T15:52:17.293000+00:00',
u'deal': {u'extra': u'0%', u'pfc': False},
u'id': u'548b0f319cb53807b216a356',
u'lifetime': VEVENT({u'DTEND': <icalendar.prop.vDDDTypes object at 0x2b04fee34cd0>, u'DTSTART': <icalendar.prop.vDDDTypes object at 0x2b04fee34fd0>}),
u'media': {u'cover': {u'author': u'548b08ff9cb53807b316a3f9',
u'content_type': u'image/jpeg',
u'id': u'548b16fd9cb53807b416b196',
u'length': 1055109,
u'md5hash': u'c5d7507d67487db44e9c4777edabd56c',
u'url': u'https://s3-eu-west-1.amazonaws.com:443/media.ticketscloud/production/image/2014-12/548b16fd9cb53807b416b196.jpe'},
View test_flows.py
import pytest
pytestmark = pytest.mark.django_db
def test_quality_flow(mixer, personal):
from core.flows import QualityFlow as flow
org = mixer.blend('core.organization', role='supplier')
View flows.py
from django.core.exceptions import ValidationError, PermissionDenied
from .models import QualityProcess
from .utils.flow import task_loader
from viewflow import flow, lock
from viewflow.base import Flow, this
class QualityFlow(Flow):
@klen
klen / configure
Last active Oct 24, 2019
OSX vim +python +python3 (pyenv)
View configure
#! /bin/sh
# This is just a stub for the Unix configure script, to provide support for
# doing "./configure" in the top Vim directory.
PY_CONFIG=`pyenv prefix 2.7.11/lib/python2.7/config`
PY3_PREFIX=`pyenv prefix 3.4.4`
PY3_CONFIG=`$PY3_PREFIX/bin/python-config --configdir`
cd src && exec ./configure \
View gist:a45e87a66ce058dd02af
[
{
"org": {
"desc": null,
"contact": {},
"name": "Organizator",
"tags": [],
"id": "5357b929f51600525c9e1396"
},
"deal": {
View gist:cafd86befa5e555c43d1
File "/usr/lib/ticketscloud/env/lib/python3.4/site-packages/raven/middleware.py", line 35, in __call__
iterable = self.application(environ, start_response)
File "/usr/lib/ticketscloud/env/lib/python3.4/site-packages/pyramid/router.py", line 242, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/usr/lib/ticketscloud/env/lib/python3.4/site-packages/pyramid/router.py", line 217, in invoke_subrequest
response = handle_request(request)
File "/usr/lib/ticketscloud/env/lib/python3.4/site-packages/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "./ticketscloud/lib/tweens.py", line 52, in __call__
raise exc
You can’t perform that action at this time.