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 xml.etree.ElementTree as ET | |
from youtrack.connection import Connection | |
class Task(object): | |
def __init__(self, title, description): | |
self.title = title.encode('utf-8') | |
self.description = description.encode('utf-8') | |
self.feature = False | |
self.sub_tasks = [] |
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 | |
import argparse | |
import sys | |
import re | |
import time | |
line_nginx_full = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""", | |
re.IGNORECASE) | |
line_nginx_onlyStatus = re.compile(r'.+HTTP\/1\.1" (?P<statuscode>\d{3})') |
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 os | |
import sys | |
def get_files(only_ext): | |
for root, sub_folders, files in os.walk("."): | |
for file in files: | |
name, ext = os.path.splitext(file) | |
if ext == only_ext: | |
yield os.path.join(root, file)[2:] |
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
var getWindows = new Promise(function(resolve) { | |
chrome.windows.getAll(function(windows) { | |
resolve(windows); | |
}); | |
}); | |
var getTabs = function(window) { | |
var p = new Promise(function(resolve) { | |
chrome.tabs.getAllInWindow(window.id, function(tabs) { |
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
function getBoundsWithBreaks (text, subString) { | |
var breaks = []; | |
_.forEach(text, function (char, index) { | |
if (char === '\n') { | |
breaks.push(index); | |
} | |
}); | |
var startIndex = text.replace(/\n/g, '').indexOf(subString); | |
if (startIndex === -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
// шлет запрос в сокет | |
_sendToMediator: function (query) { | |
var self = this; | |
return self._getMediator() | |
.then(function () { | |
if ( !self.mediator.connected ) { | |
// пытаемся еще раз подключиться к медиатору | |
self._getMediator(true); | |
return self.$q.reject(null); | |
} |
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
var all_points = []; | |
var paths = route.getPaths(); | |
var i = 0; | |
while (paths.get(i) !== null) { | |
var p = paths.get(i); | |
var segments = p.getSegments(); | |
$(segments).each(function() { | |
var pc = this.getCoordinates(); | |
$(pc).each(function() { | |
all_points.push(this); |
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 ubuntu:14.04 | |
RUN apt-get update && apt-get install -y firefox | |
# Replace 1000 with your user / group id | |
RUN export uid=1000 gid=1000 && \ | |
mkdir -p /home/developer && \ | |
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \ | |
echo "developer:x:${uid}:" >> /etc/group && \ | |
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \ |
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
Show hidden characters
{ | |
"rules": { | |
"member-access": true, | |
"member-ordering": [ | |
true, | |
"public-before-private", | |
"static-before-instance", | |
"variables-before-functions" | |
], | |
"no-any": false, |
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
#!/bin/bash | |
now=$(date +"%Y-%m-%d_%H:%M") | |
cd /projects/datamarket | |
pg_dump -U postgres dm | gzip > backups/dm_dump_$now.sql.gz | |
# use this row to backup every hour | |
# crontab -e | |
# * */1 * * * /projects/datamarket/dump.sh |
OlderNewer