class UserSerializer(serializers.Serializer):
email = serializers.EmailField()
name = serializers.CharField()
class UserSerializer(serializers.Serializer):
--- | |
version: "3.7" | |
networks: | |
traefik_proxy: | |
name: traefik_proxy | |
driver: bridge | |
services: | |
traefik: |
// from https://hackernoon.com/using-a-react-16-portal-to-do-something-cool-2a2d627b0202 | |
function copyStyles(sourceDoc, targetDoc) { | |
Array.from(sourceDoc.styleSheets).forEach(styleSheet => { | |
if (styleSheet.cssRules) { // true for inline styles | |
const newStyleEl = sourceDoc.createElement('style'); | |
Array.from(styleSheet.cssRules).forEach(cssRule => { | |
newStyleEl.appendChild(sourceDoc.createTextNode(cssRule.cssText)); | |
}); |
function css() { | |
var args = []; | |
for (var _i = 0; _i < arguments.length; _i++) { | |
args[_i] = arguments[_i]; | |
} | |
var classes = []; | |
for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { | |
var arg = args_1[_a]; | |
if (arg) { | |
if (typeof arg === 'string') { |
import React, { Component } from 'react'; | |
import { BrowserRouter, Route, NavLink, Link, Switch, Redirect } from 'react-router-dom'; | |
import axios from 'axios'; | |
/* | |
* HOME PAGE - SEARCH * | |
*/ | |
class HomePage extends Component { |
// Approach 1: Use React.createClass | |
var HelloWorld = React.createClass({ | |
getInitialState() { | |
return { message: 'Hi' }; | |
}, | |
logMessage() { | |
// this magically works because React.createClass autobinds. | |
console.log(this.state.message); | |
}, |
from django.db import models | |
from django.contrib.auth.models import AbstractBaseUser | |
from django.core.validators import RegexValidator | |
# ... | |
class User(AbstractBaseUser): | |
# ... | |
phone_number = models.CharField( | |
max_length=16, |
#!/usr/bin/python3 | |
import time | |
def new_d(): | |
return { | |
1: 2, 3: 4, 5: 6, 7: 8, 9: 10, | |
11: 12, 13: 14, 15: 16, 17: 18, 19: 20 | |
} |
# from https://stackoverflow.com/questions/2180270/check-if-current-directory-is-a-git-repository | |
[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1 |