Skip to content

Instantly share code, notes, and snippets.

View asfaltboy's full-sized avatar

Pavel Savchenko asfaltboy

View GitHub Profile
@asfaltboy
asfaltboy / TrelloAPI.json
Last active October 2, 2018 19:48
[WIP]: generated swagger of trello api docs
{
"info": {
"termsOfService": "https://trello.com/legal",
"description": "This document describes the REST API of Trello as published by Trello.com. <a href='https://trello.com/docs/index.html' target='_blank'>Official Documentation</a>",
"license": {
"url": "https://trello.com/legal",
"name": "Trello : Terms of Service"
},
"title": "Trello API",
"contact": {
@asfaltboy
asfaltboy / output.log
Created September 15, 2018 14:51
python-dotenv run continuous output issue 137 (https://github.com/theskumar/python-dotenv/issues/137)
$ python test.py
Starting running with handlers [<StreamHandler <stderr> (NOTSET)>, <StreamHandler <stdout> (NOTSET)>]
ERROR:root:Test log
Test log
ERROR:root:Test log
Test log
^CTraceback (most recent call last):
File "test.py", line 13, in <module>
time.sleep(1)
KeyboardInterrupt
@asfaltboy
asfaltboy / anaconda_jsonserver.v2.1.27.log
Last active July 6, 2018 12:07
st3 anaconda IDE issue logs
2018-07-06 13:53:15,399: INFO : process 61387 does not exists stopping server...
2018-07-06 13:53:15,405: INFO : Closing the socket, server will be shutdown now...
2018-07-06 13:54:04,737: DEBUG : bind: address=('localhost', 56943)
2018-07-06 13:54:04,738: DEBUG : listen: backlog=5
2018-07-06 13:54:04,738: INFO : Anaconda Server started in 56943 for PID 95659 with cache dir /Users/pavel.savchenko/Library/Caches/Jedi/my_project and extra paths /Users/pavel.savchenko/dev/my_project
2018-07-06 13:54:04,744: INFO : Incomming connection from ('127.0.0.1', 56955)
2018-07-06 13:54:04,746: INFO : Incomming connection from ('127.0.0.1', 56956)
2018-07-06 13:54:04,789: INFO : client requests: lint
2018-07-06 13:54:24,896: INFO : client requests: goto
2018-07-06 13:54:28,078: INFO : client requests: goto
@asfaltboy
asfaltboy / keybase.md
Created April 8, 2018 17:53
keybase.md

Keybase proof

I hereby claim:

  • I am asfaltboy on github.
  • I am psav (https://keybase.io/psav) on keybase.
  • I have a public key ASDxF_wNcAkMRJscntEXV4qGrYrPatF1SjhAxlyFigkNtQo

To claim this, I am signing this object:

@asfaltboy
asfaltboy / output.log
Created April 5, 2018 20:29
django-braces pytest output coverage
GLOB sdist-make: /Users/pavel.savchenko/github/django-braces/setup.py
py27-django15 inst-nodeps: /Users/pavel.savchenko/github/django-braces/.tox/dist/django-braces-1.12.0.zip
py27-django15 installed: coverage==4.1,Django==1.5.12,django-braces==1.12.0,factory-boy==2.8.1,Faker==0.8.12,funcsigs==1.0.2,ipaddress==1.0.19,mock==2.0.0,pbr==4.0.1,py==1.5.3,pytest==2.9.1,pytest-cov==2.5.1,pytest-django==2.9.1,python-dateutil==2.7.2,six==1.11.0,text-unidecode==1.2
py27-django15 runtests: PYTHONHASHSEED='3147501103'
py27-django15 runtests: commands[0] | py.test tests --cov=braces
============================= test session starts ==============================
platform darwin -- Python 2.7.14, pytest-2.9.1, py-1.5.3, pluggy-0.3.1
rootdir: /Users/pavel.savchenko/github/django-braces, inifile:
plugins: django-2.9.1, cov-2.5.1
collected 210 items
@asfaltboy
asfaltboy / command.js
Last active October 27, 2017 17:15
(Backtick command) Add mono-space shortcut in confluence editor
tinyMCE.activeEditor.addShortcut("ctrl+alt+m","monospace","confMonospace")
@asfaltboy
asfaltboy / Instructions.md
Last active October 26, 2017 10:00
Log all cronjob output to syslog and send errors to sentry

Log cronjob output to syslog and send errors to sentry

The wonderful [cron-sentry][1] takes care of sending an event for program errors to sentry. To uniformy log everything outputted, we pipe both stderr and stdout to [logger][2] (should be available on most linux distros)

How to use

Download script, add execution perm and move to a directory on PATH

$ wget https://gist.githubusercontent.com/asfaltboy/23a7f963bbfcb48ce510307ec8cb8737/raw/49ebca20004211a16c85a61a77db7d0883ddf31c/log-and-sentry

$ chmod +x log-and-sentry

@asfaltboy
asfaltboy / anagram_lookup.py
Created November 23, 2016 18:12
anagram phrase comparison
from hashlib import md5
from collections import Counter
import itertools
import sys
import time
MATCH_MSG = '>>> We have a match!!! This phrase matches the mt5 hash'
def get_relevant_words(target):
@asfaltboy
asfaltboy / foo2.py
Created November 21, 2016 21:37
example of exception raised in daemon thread
from datetime import datetime
from Queue import Queue
import threading
import time
def worker(q):
while True:
item = q.get()
@asfaltboy
asfaltboy / py-env-guide.rst
Last active September 25, 2016 08:10
Multiple python versions with PyEnv

Multiple python versions

Reasoning and use cases

There are often scenarios when we would need to install multiple versions of python.

On on our development machine, we might want to work on many projects, some using different python versions, or maybe we're working on a package that we want to support on multiple