This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Obj.objects.extra(select={'num': "(select @f2 := @f2 +1 from (select @f2 := 0) as t )"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE <BDname> CHARACTER SET utf8 COLLATE utf8_general_ci; | |
GRANT ALL PRIVILEGES ON <BDname>.* to <user_name>@localhost identified by '<user_password>'; | |
for crone: | |
mysqldump -u <user_name> '-p<user_password>' <oldBDname> | gzip > ~/$(date +/var/sqlDump/<oldBDname>.sql.%Y%m%d.gz) | |
gunzip < `date +/var/sqlDump/<oldBDname>.sql.%Y%m%d.gz` | mysql -u <user_name> '-p<user_password>' <BDname> | |
CREATE USER <un> WITH PASSWORD '<up>'; | |
CREATE DATABASE sales ENCODING 'utf8' OWNER <un>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var onLoader = function onloader(call, selector) | |
{ | |
var loaderTimer = setInterval(function() | |
{ | |
if ( | |
!$(selector).filter(function() | |
{ | |
return !this.complete | |
}).length | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DATE_FORMAT(d, "%Y%m") as month_year, GROUP_CONCAT(id SEPARATOR ',') as ids FROM events_event GROUP BY month_year LIMIT 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kill -9 $(ps aux | grep RefreshDate | awk '{print $2}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.general_cont { | |
height: auto !important; | |
min-height: 100%; | |
height: 100%; | |
} | |
.footer { | |
margin-top: -216px; | |
padding: 0 30px 0px 30px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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'); | |
}); |