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
import React, { | |
createContext, | |
useEffect, | |
useState, | |
useContext, | |
useCallback, | |
Fragment | |
} from "react"; | |
import { ScrollView } from "react-native"; | |
import { Portal, Dialog, List, Button } from "react-native-paper"; |
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
import React, { PureComponent } from 'react' | |
import PropTypes from 'prop-types' | |
import { connect } from 'dva' | |
import { Row, Col, Card } from 'antd' | |
import { Color } from 'utils' | |
import { Page, ScrollBar } from 'components' | |
import { | |
NumberCard, | |
Quote, | |
Sales, |
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
from django_countries import countries | |
from django.db.models import Q | |
from django.conf import settings | |
from django.core.exceptions import ObjectDoesNotExist | |
from django.http import Http404 | |
from django.shortcuts import render, get_object_or_404 | |
from django.utils import timezone | |
from rest_framework.generics import ( | |
ListAPIView, RetrieveAPIView, CreateAPIView, | |
UpdateAPIView, DestroyAPIView |
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
from django.contrib import admin | |
from .models import ( | |
Item, OrderItem, Order, Payment, Coupon, Refund, | |
Address, UserProfile, Variation, ItemVariation | |
) | |
def make_refund_accepted(modeladmin, request, queryset): | |
queryset.update(refund_requested=False, refund_granted=True) |
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
/** @jsx jsx */ | |
import { jsx } from '@emotion/core' | |
import { FunctionComponent, HTMLAttributes, useMemo, useState, useEffect } from 'react' | |
import Calendar from 'react-calendar/dist/entry.nostyle' | |
import dayjs from 'dayjs' | |
import { Icon, Button, Clickover, Text } from '~/components' | |
import { styles } from './styles' | |
// @ts-ignore |
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
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { withStyles } from '@material-ui/core/styles'; | |
import { CircularProgress } from '@material-ui/core'; | |
const defaultSize = 50; | |
class ColoredCircularProgressComponent extends Component { | |
render() { | |
const { classes, size } = this.props; |
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
// flatten the array of integers | |
const flatten = array => | |
JSON.stringify(array) // JSON encode the array to make string | |
.match(/\d+/g) // extract numbers using regex | |
.map(x => parseInt(x)); // convert string to numbers | |
// unit testing with Mocha | |
var assert = require('assert'); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
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
using Microsoft.Extensions.Options; | |
using System.Threading.Tasks; | |
using Twilio; | |
using Twilio.Rest.Api.V2010.Account; | |
using Twilio.Types; | |
namespace Web2FA.Services | |
{ | |
// This class is used by the application to send Email and SMS | |
// when you turn on two-factor authentication in ASP.NET Identity. |
OlderNewer