Skip to content

Instantly share code, notes, and snippets.

Gennady Chibisov chibisov

View GitHub Profile
@chibisov
chibisov / gist:71706c196042e3ae1193
Created Jun 17, 2015
Mute yandex radio advertisment
View gist:71706c196042e3ae1193
window.setInterval(function(){
var volumeShouldBeOn = true;
var volumeIsOn = !Boolean($('.volume__icon_mute').length);
var isAdvShown = $('.slider__item_advert.slider__item_shown').length;
if (isAdvShown) {
volumeShouldBeOn = false;
}
if ((volumeShouldBeOn && !volumeIsOn) || (!volumeShouldBeOn && volumeIsOn)) {
$('.volume__btn').click();
}
View QuerySet wrapper
class QuerySet(object):
def __init__(self, query=None):
self.query = query or {}
def _clone(self):
return type(self)(query=deepcopy(self.query))
def __getitem__(self, k):
if isinstance(k, slice):
@chibisov
chibisov / gist:10470006
Created Apr 11, 2014
django-guardian compat.py
View gist:10470006
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.auth.models import AnonymousUser
from django.utils.importlib import import_module
import six
import sys
@chibisov
chibisov / python
Last active Dec 22, 2015
Show request info in chrome dev tools manner. Tornado used
View python
#!/usr/bin/env python
"""
$ curl -d 'hello=world' http://localhost:8888/path/?someparam=1
Request URL: http://localhost:8888/path/?someparam=1
Request Method: POST
Request Headers:
Host: localhost:8888
Content-Type: application/x-www-form-urlencoded
@chibisov
chibisov / chosen-custom-styles.css
Created Dec 13, 2011
admin/plugins/chosen/chosen-custom-styles.css
View chosen-custom-styles.css
.form-row{
overflow: visible !important;
}
.form-row:after{
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
You can’t perform that action at this time.