Skip to content

Instantly share code, notes, and snippets.

@chibisov
chibisov / chosen-custom-styles.css
Created December 13, 2011 09:29
admin/plugins/chosen/chosen-custom-styles.css
.form-row{
overflow: visible !important;
}
.form-row:after{
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
@chibisov
chibisov / python
Last active December 22, 2015 19:49
Show request info in chrome dev tools manner. Tornado used
#!/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 / gist:10470006
Created April 11, 2014 13:42
django-guardian compat.py
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
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:71706c196042e3ae1193
Created June 17, 2015 12:19
Mute yandex radio advertisment
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();
}