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 app import app | |
| @app.route('/') | |
| @app.route('/index') | |
| def index(): | |
| return "Hello World" |
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 time | |
| flask_apps_dir = { | |
| "flask_dirs": [ | |
| "app", | |
| "app/templates", | |
| "app/static", | |
| "temp" | |
| ], |
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 urllib.parse as urlparse | |
| from urllib.parse import urlencode | |
| def urlparser(**params_dict): | |
| kv = {} | |
| for k, v in params_dict.items(): | |
| if v: | |
| kv[k] = v |
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
| function LoginService() { | |
| var self = this; | |
| self.login = function(jsonData, url) { | |
| return $.ajax({ | |
| url: "{% url 'appmain:ajax-login' %}", | |
| type: "POST", | |
| data: jsonData | |
| }); | |
| }; |
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 abc | |
| class IFulfillmentCommon(metaclass=abc.ABCMeta): | |
| @abc.abstractmethod | |
| def create(self, *args, **kwargs): | |
| pass | |
| class IFulfillmentTripHelpers(IFulfillmentCommon): | |
| @abc.abstractmethod |
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 abc | |
| class Director(object): | |
| def __init__(self): | |
| self._builder = None | |
| def construct(self, builder): | |
| self._builder = builder | |
| return [ |
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 rest_framework import status | |
| from rest_framework.authentication import SessionAuthentication, BasicAuthentication | |
| from rest_framework.decorators import api_view, authentication_classes | |
| from rest_framework.pagination import PageNumberPagination | |
| from rest_framework.response import Response | |
| from rest_framework_jwt.authentication import JSONWebTokenAuthentication | |
| from mysite.models import Product, Customer | |
| from mysite.serializers import ProductListGetSerializer, ProductListPostSerializer, CustomerListGetSerializer, \ | |
| CustomerListPostSerializer, CustomerDetailGetSerializer, CustomerDetailPutSerializer |
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
| <Page | |
| x:Class="KelontongDesktop.ProductList" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:local="using:KelontongDesktop" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| mc:Ignorable="d" | |
| Loaded="Page_LoadedAsync"> | |
| <Page.Resources> |
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 abc | |
| class DBServiceInterface(abc.ABC): | |
| """ | |
| This class like a 'Business Service (interface)' | |
| """ | |
| @abc.abstractmethod | |
| def connect(self, *args, **kwargs): | |
| raise NotImplementedError() |
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 React, { Component } from 'react'; | |
| import axios from 'axios'; | |
| import { Redirect } from 'react-router-dom'; | |
| const HOCGuardAuthentication = (ComposedComponent) => | |
| class extends Component { | |
| constructor(props) { | |
| super(props); |