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 socket | |
from BaseHTTPServer import HTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
class HTTPServerV6(HTTPServer): | |
address_family = socket.AF_INET6 | |
def main(): | |
server = HTTPServerV6(('::', 8081), SimpleHTTPRequestHandler) | |
server.serve_forever() |
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://docs.docker.com/engine/install/ubuntu/ | |
# На маке без sudo | |
sudo docker run -d \ | |
--name clickhouse-server \ | |
--ulimit nofile=262144:262144 \ | |
-p 0.0.0.0:8123:8123 -p 0.0.0.0:9000:9000 \ | |
--restart always \ | |
--network redash-docker-compose_default \ | |
-v "$(pwd)/ch-data:/var/lib/clickhouse" \ | |
yandex/clickhouse-server |
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
ALTER TABLE `oc_product_to_store` ADD INDEX(`store_id`); | |
ALTER TABLE `oc_product_description` ADD INDEX(`language_id`); | |
ALTER TABLE `oc_category_path` ADD INDEX(`path_id`, `category_id`); | |
ALTER TABLE `oc_category_path` ADD INDEX(`category_id`, `path_id`); | |
SET sql_mode = 'STRICT_TRANS_TABLES'; -- mysql 5.7 | |
ALTER TABLE `oc_product` ADD INDEX(`status`); | |
-- Add these to speed up OpenCart | |
ALTER TABLE `oc_product` ADD INDEX(`date_available`, `status`); |
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 | |
apk=$1 | |
package=$2 | |
if [ ! -f $apk ]; then | |
echo "APK $apk not exist" | |
exit 1 | |
fi |
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 ConfigParser import RawConfigParser | |
class SafeConfigParser(object, RawConfigParser): | |
def __init__(self, **kwargs): | |
RawConfigParser.__init__(self, **kwargs) | |
def get(self, section, option, default=None): | |
try: | |
return super(SafeConfigParser, self).get(section, option) |
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
javascript:(function(){function count(){var cost=0;$(".train-info__route-info-holder b:nth-child(2n)")["each"](function (){var filteredPrice=$(this)["html"]()["replace"](/(\ \;| |руб)/g,"");var price=parseFloat(filteredPrice)||0;cost+=price;} );alert("Всего потрачено "+cost+" Р.");} ;function loop(){if(!$("#MoreOwner")["is"](":visible")&&!$("#WaitMsg")["is"](":visible")){count();} else {$("#MoreButton")["trigger"]("click");setTimeout(loop,1000);} ;} ;loop();}()) |
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://gist.github.com/grigory51/e6b04282cc1261b891fd | |
function count() { | |
var cost = 0; | |
$('.train-info__route-info-holder b:nth-child(2n)').each(function(){ | |
var filteredPrice = $(this).html().replace(/(\ \;| |руб)/g, ''); | |
var price = parseFloat(filteredPrice) || 0; | |
cost+=price; | |
}); |
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
#include <ncurses.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include "game.h" | |
static void finish(int sig); | |
int main(int argc, const char * argv[]) { |
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 selenium import webdriver | |
from unittest import TestCase, TestLoader | |
import selenium.webdriver.support.ui as ui | |
import time | |
import string | |
import junitxml | |
import sys |
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 selenium import webdriver | |
from unittest import TestCase, TestLoader | |
import selenium.webdriver.support.ui as ui | |
import time | |
import string | |
import junitxml | |
import sys |
NewerOlder