Skip to content

Instantly share code, notes, and snippets.

View y10h's full-sized avatar

Yury Yurevich y10h

  • San Francisco Bay Area
View GitHub Profile
@y10h
y10h / omskvelofix.js
Last active June 1, 2016 06:33
TamperMonkey script to fix too close vote up/vote down buttons.
// ==UserScript==
// @name OmskveloVoteFix
// @namespace https://gist.github.com/j2a/76933e7d9c8dd7067ef4fa89cf3af75e/edit
// @version 0.1
// @description Fix size and position of voting buttons on omskvelo.ru.
// @author Yury Yurevich
// @match http://omskvelo.ru/index.php?/topic/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js
// ==/UserScript==
#!/usr/bin/env python
import random
import redis
def adjust_score(score):
return score + random.choice([-0.5, +0.5])
def store_set(set_x, key, cli):
@y10h
y10h / redis_vs_sqlite.py
Created November 7, 2011 10:04 — forked from perses76/redis_vs_sqlite.py
Redis vs SQLite
from datetime import datetime
import redis
import random
import sqlite3
BROKER_HOST = "localhost" # Maps to redis host.
REDIS_PASSWORD = None
KEY_PREFIX = "speed_"
ALPHABETE = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM"
SQLITE_DB = ":memory:"
diff --git a/procrustes/__init__.py b/procrustes/__init__.py
index a0aa83e..6c31d06 100644
--- a/procrustes/__init__.py
+++ b/procrustes/__init__.py
@@ -1,7 +1,5 @@
# (c) Svarga project under terms of the new BSD license
-__version__ = '0.1'
-
from functools import partial
#!/usr/bin/env python
"""
Bootstrap script for prepare environ for project
"""
import os
import subprocess
import optparse
import sys
diff --git a/django_jenkins/tasks/with_coverage.py b/django_jenkins/tasks/with_coverage.py
index 716d269..29c234c 100644
--- a/django_jenkins/tasks/with_coverage.py
+++ b/django_jenkins/tasks/with_coverage.py
@@ -29,7 +29,7 @@ class Task(BaseTask):
super(Task, self).__init__(test_labels, options)
self.test_apps = get_apps_under_test(test_labels, options['test_all'])
self.output_dir = options['output_dir']
- self.excludes = options['coverage_excludes']
+ self.excludes = options['coverage_excludes'] or [os.environ['DJANGO_SETTINGS_MODULE']]
$ git clone git://github.com/ask/celery.git
$ sloccount celery/celery | grep "Source Lines of Code"
Total Physical Source Lines of Code (SLOC) = 15,771
$ rm -rf celery/celery/tests
$ sloccount celery/celery | grep "Source Lines of Code"
Total Physical Source Lines of Code (SLOC) = 10,204
#!/usr/bin/env python
import os
import sys
import time
import signal
def show(sig, frame):
print "got signal %s" % sig
def exit(sig, frame):
# hg redirections
redirects = {
'/': 'http://github.com/j2a',
'byteflow-pyo': 'http://bitbucket.org/j2a/pyo-byteflow',
'pytils': 'http://github.com/j2a/pytils',
'ydbf': 'http://github.com/j2a/ydbf',
'zepto': 'http://bitbucket.org/j2a/zepto',
}
import urlparse
class Base(object):
def __init__(self, x):
print "Base - %s" % x
class Inherited(Base):
def __init__(self):
super(Inherited, self).__init__('foo')
print "Inherited"
o = Inherited()