URL | Method | Query | Body | Data returned | Permissions | Description |
---|---|---|---|---|---|---|
api/users/ | GET | List of users | List users for requesting user's company | |||
company=# |
filter by company | Admins only |
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 https://stackoverflow.com/questions/2180270/check-if-current-directory-is-a-git-repository | |
[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1 |
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
#!/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 | |
} |
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 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, |
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
// 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); | |
}, |
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 { BrowserRouter, Route, NavLink, Link, Switch, Redirect } from 'react-router-dom'; | |
import axios from 'axios'; | |
/* | |
* HOME PAGE - SEARCH * | |
*/ | |
class HomePage extends Component { |
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 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') { |
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 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)); | |
}); |
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
--- | |
version: "3.7" | |
networks: | |
traefik_proxy: | |
name: traefik_proxy | |
driver: bridge | |
services: | |
traefik: |