Skip to content

Instantly share code, notes, and snippets.

@H2Otic
H2Otic / vestacp.nginx.tpl
Created September 14, 2017 12:14
VestaCp nginx config template
server {
listen %ip%:%proxy_port%;
server_name %alias_idn%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
return 301 http://%domain%$request_uri;
location / {
proxy_pass http://%ip%:%web_port%;
location ~* ^.+\.(%proxy_extentions%)$ {
@H2Otic
H2Otic / vestacp.wsgi.tpl
Last active March 30, 2021 18:37
VestaCp wsgi config template
<VirtualHost %ip%:%web_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %docroot%
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
SuexecUserGroup %user% %group%
@H2Otic
H2Otic / django_date_formats.md
Last active March 29, 2017 20:03
Django date format strings
Format character Description Example output
a 'a.m.' or 'p.m.'
A 'AM' or 'PM'
b Month, textual, 3 letters, lowercase. 'jan'
c ISO 8601 format. 2008-01-02T10:30:00.000123+02:00, or 2008-01-02T10:30:00.000123
d '01' to '31'
D 'Fri'
E Month, locale specific alternative representation usually used for long date representation. 'марта' for Russian locale, as opposed to 'March'
e Timezone name. Could be in any format, or might return an empty string, depending on the datetime. '', 'GMT', '-500', 'US/Eastern', etc.
@H2Otic
H2Otic / gist:6c1db35c7ed3c1924e18e00c3e6afd40
Last active October 7, 2016 12:50
Dadata angularjs directive
app.directive('dadata', function () {
function link(scope, element) {
$(element).suggestions({
serviceUrl: 'https://dadata.ru/api/v2',
token: '...',
type: 'ADDRESS',
onSelect: function (suggestion) {
var city = (suggestion.data.city) ? suggestion.data.city : suggestion.data.area_with_type;
scope.data['address'] = suggestion.unrestricted_value;
scope.data['region'] = suggestion.data.region_with_type;