Skip to content

Instantly share code, notes, and snippets.

# XTERM TWEAKS
# ===============================================================
#
#
# Set term to xterm-color
#term screen
term xterm-256color
#term xterm-color
"""
Django settings for surgut project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
@ErDmKo
ErDmKo / PopUp.js
Created April 4, 2014 08:52
JavaScript poper and slider
function extend(cls, superCls)
{
var construct = function () {};
construct.prototype = superCls.prototype;
cls.prototype = new construct();
cls.prototype.constructor = cls;
var obj = superCls;
cls.index = 0;
cls.extend_array = [obj];
while (typeof obj != 'undefined' && obj.hasOwnProperty('super'))
$(document).on('click', function(e){
var elem = $(e.target),
contanier =$('.events_list');
if (elem.closest('.events_list').length){
if (elem.is('.open_close')){
contanier.toggleClass('open');}}
else
contanier.removeClass('open');
});
@ErDmKo
ErDmKo / general.css
Created March 26, 2014 08:35
bottom footer feature
.general_cont {
height: auto !important;
min-height: 100%;
height: 100%;
}
.footer {
margin-top: -216px;
padding: 0 30px 0px 30px;
}
@ErDmKo
ErDmKo / forms.py
Created February 10, 2014 16:17
Select, radio and checkbox customization django
#change standart widget to choice inputs https://github.com/django/django/blob/master/django/forms/widgets.py#L577
class MyForm(forms.ModelForm):
class Meta:
model = office_models.myForm
fields = ['education', 'occupation', 'post', \
'neighborhood', 'man_count', 'with_animals']
widgets = {
'education': forms.RadioSelect,
'occupation': forms.RadioSelect,
@ErDmKo
ErDmKo / gist:8752000
Created February 1, 2014 12:50
Group process killer
kill -9 $(ps aux | grep RefreshDate | awk '{print $2}')
@ErDmKo
ErDmKo / date_group.sql
Created January 24, 2014 12:08
Group elements by date and get elements id list from group.
SELECT DATE_FORMAT(d, "%Y%m") as month_year, GROUP_CONCAT(id SEPARATOR ',') as ids FROM events_event GROUP BY month_year LIMIT 100
@ErDmKo
ErDmKo / me.conf
Last active January 3, 2016 08:09
mysql config
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
collation_server=utf8_unicode_ci
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
@ErDmKo
ErDmKo / loader.js
Created December 4, 2013 17:21
Image loader even caller
var onLoader = function onloader(call, selector)
{
var loaderTimer = setInterval(function()
{
if (
!$(selector).filter(function()
{
return !this.complete
}).length
)