This file contains hidden or 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
# FIXME mozna presunout na webserver caddy? | |
# https://caddyserver.com/docs/http.jwt | |
def auth_check(func=None, realm="private", text="Access denied"): | |
"""Wrapper na basic/token/IP autorizaci""" | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
if IP(request.remote_addr) in IPSet([IP("10.0.0.0/8"), IP("172.16.0.0/12"), IP("192.168.0.0/16")]): | |
return func(*args, **kwargs) | |
if "token" in request.GET: |
This file contains hidden or 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
# Author Ondrej Barta | |
# [email protected] | |
# Copyright 2017 | |
import pprint | |
import facebook | |
from django.core.management.base import BaseCommand | |
from ...models import Client |
This file contains hidden or 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
# Author Ondrej Barta | |
# [email protected] | |
# Copyright 2017 | |
import facebook | |
from django.contrib.auth.decorators import login_required | |
from django.http import HttpResponse, Http404 | |
from django.shortcuts import redirect | |
from settings import FACEBOOK_APP_SECRET, FACEBOOK_APP_ID, FACEBOOK_REDIRECT_URL |
This file contains hidden or 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
jQuery(function ($) { | |
"use strict"; | |
/** | |
* Reset the message. | |
*/ | |
function resetMessage() { | |
$("#result") | |
.removeClass() | |
.text(""); |
This file contains hidden or 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
package main | |
import ( | |
"log" | |
"net/http" | |
"golang.org/x/net/webdav" | |
"fmt" | |
"flag" | |
) |
This file contains hidden or 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
from time import time | |
from collections import defaultdict | |
from inspect import stack | |
from django.dispatch import Signal | |
from django.utils.translation import ugettext_lazy as _ | |
from debug_toolbar.panels import Panel | |
from django.template import Template as DjangoTemplate |
This file contains hidden or 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
import os | |
import yaml | |
from lib import LazyDict | |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | |
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
# Load config file |
This file contains hidden or 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
<script> | |
var manualUploader = new qq.FineUploader({ | |
element: document.getElementById('fine-uploader-manual-trigger'), | |
template: 'qq-template-manual-trigger', | |
request: { | |
endpoint: "http://127.0.0.1:8888/upload" | |
}, | |
cors: { | |
//all requests are expected to be cross-domain requests | |
expected: true |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# | |
# Author Ondrej Barta | |
# [email protected] | |
# Copyright 2017 | |
import os | |
from urllib import unquote | |
from urlparse import urlparse |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# | |
# Author Ondrej Barta | |
# [email protected] | |
# Copyright 2017 | |
import os | |
import boto3 | |
import easywebdav | |
import magic |