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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Page Rank CSV sorter | |
Usage: | |
pr_sort.py /path/to/csv-file.csv [/path/to/output-file.csv] | |
Output filename is not required, and if not supplied, output goes to the stdout. | |
""" |
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 __future__ import print_function | |
import sys | |
import timeit | |
l = list(range(10)) | |
t = tuple(l) | |
def func(obj): | |
r = list(range(1000)) | |
for i in r: |
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
mysql> SELECT COUNT(*) FROM auth_user; | |
+----------+ | |
| COUNT(*) | | |
+----------+ | |
| 48158 | | |
+----------+ | |
1 row in set (0.00 sec) | |
mysql> EXPLAIN SELECT COUNT(*) FROM auth_user WHERE is_staff = 1; | |
+----+-------------+-----------+------+---------------+------+---------+------+-------+-------------+ |
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
database=> SELECT COUNT(*) FROM auth_user; | |
count | |
------- | |
1076 | |
(1 row) | |
database=> EXPLAIN SELECT COUNT(*) FROM auth_user WHERE is_staff = False; | |
QUERY PLAN | |
------------------------------------------------------------------- | |
Aggregate (cost=26.80..26.81 rows=1 width=0) |
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
requests.put('http://localhost:9200/site/', data=json.dumps({ | |
'settings': { | |
'analysis': { | |
'analyzer': { | |
'ru': { | |
'type': 'custom', | |
'tokenizer': 'standard', | |
"filter": ['lowercase', 'russian_morphology', 'english_morphology', 'ru_stopwords'], | |
}, | |
}, |
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
#irkutsk OR #twirkutsk OR #irkru OR #Иркутск -HeepUriah -kareetc64 -BEM_Irkutsk -OWS633 -OWS337 -OWS334 -SimonDeMonfor -naidikvartiru -deSAD -myvotefactor -Dezirtir -RomanovPP -Ostaked -2Vitel -er_Irkutsk -avtonom_org -OWS557 -vumatin -optimumirk -inkadoru -er_Irkutsk -UDACHA_MARKET -deloirk -RRABBOTTA -BystroZaim -IrkutskDate -tvoemoehelp -irkutskyoutube -irk_fan_shop |
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
# -*- coding: utf-8 -*- | |
from logging.handlers import SocketHandler | |
import msgpack # https://pypi.python.org/pypi/msgpack-python | |
class FluentdHandler(SocketHandler): | |
def __init__(self, host='localhost', port=24224): |
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
Info: Initialized SDL | |
Info: Initialized SDL Video | |
Info: Initialized SDL Joystick | |
Info: Initialized SDL Sound | |
Info: Opened default audio device with 44khz / 16 bit stereo audio, 940 sample size buffer | |
Error: Error loading player file, ignoring! IOException: Wrong magic bytes at start of versioned blob, expected 'SBPFV1.1' | |
./starbound(_ZN4Star13StarExceptionC2ERKSs+0xe7) [0x8883077] | |
./starbound() [0x8593db9] | |
./starbound() [0x84ce1ec] | |
./starbound(_ZNSt23_Sp_counted_ptr_inplaceIN4Star13PlayerStorageESaIS1_ELN9__gnu_cxx12_Lock_policyE2EEC2IINS0_6StringEEEES2_DpOT_+0x44) [0x81cdd64] |
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 std; | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8000"; | |
} | |
sub vcl_recv { | |
return (lookup); |
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
[uwsgi] | |
master = true | |
socket = 127.0.0.1:8080 | |
pidfile = /tmp/svartalf.pid | |
processes = 4 | |
home = /home/svartalf/projects/svartalf/.env | |
pythonpath = /home/svartalf/projects/svartalf/ | |
mount = /=/home/svartalf/projects/irk/wsgi.py | |
enable-threads = true | |
optimize = 1 |
OlderNewer