Skip to content

Instantly share code, notes, and snippets.

View grigory51's full-sized avatar
✌️
Бодрячком! Все возможно!

Grigory Ozhegov grigory51

✌️
Бодрячком! Все возможно!
View GitHub Profile
# -*- 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
@grigory51
grigory51 / main.py
Created May 14, 2013 23:03
last_version
# -*- 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
@grigory51
grigory51 / main.py
Created May 14, 2013 23:23
final i want to sleep
# -*- 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
#include <ncurses.h>
#include <signal.h>
#include <stdlib.h>
#include "game.h"
static void finish(int sig);
int main(int argc, const char * argv[]) {
@grigory51
grigory51 / gist:305edb3cfdb295ffd013
Last active August 29, 2015 14:08
Скрипт, который считает сколько за все время вы потратили денег на покупку билетов на rzd.ru.
//Версия для вставку в строку браузера 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(/(\&nbsp\;| |руб)/g, '');
var price = parseFloat(filteredPrice) || 0;
cost+=price;
});
@grigory51
grigory51 / gist:e6b04282cc1261b891fd
Last active August 29, 2015 14:08
https://gist.github.com/grigory51/305edb3cfdb295ffd013 для вставки в строку браузера
javascript:(function(){function count(){var cost=0;$(".train-info__route-info-holder b:nth-child(2n)")["each"](function (){var filteredPrice=$(this)["html"]()["replace"](/(\&nbsp\;| |руб)/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();}())
@grigory51
grigory51 / gist:3a91f7f1507cbd5f993a
Last active April 10, 2018 00:33
Safe RawConfigParser with default value
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)
@grigory51
grigory51 / apk2all.sh
Created November 24, 2016 16:54
Upload apk to all connected devices
#!/bin/bash
apk=$1
package=$2
if [ ! -f $apk ]; then
echo "APK $apk not exist"
exit 1
fi
@grigory51
grigory51 / indexes_to_add.sql
Last active July 6, 2024 11:37 — forked from mitio/indexes_to_add.sql
OpenCart SQL profiler and indexes for improved speed and page load time
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`);
# Установка докера: 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