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
/** | |
* Pad zero | |
* @param Number number | |
* @param Number size | |
* @return String | |
*/ | |
const zeroLeft = (number,size) => { | |
var sign = Math.sign(number) === -1 ? '-' : ''; | |
return sign + new Array(size).concat([Math.abs(number)]).join('0').slice(-size); | |
} |
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
server { | |
listen 80; | |
server_name faceapi.znt; | |
location / { | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_pass http://127.0.0.1:8000; | |
} |
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
/** | |
* only number field filter | |
*/ | |
const keyRange = [...Array(11).keys()].map(x => x + 48); | |
export const onlyNumber = (e) => { | |
if(-1 === keyRange.indexOf(e.which)){ | |
e.preventDefault(); | |
} | |
} |
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
/** | |
* Component test | |
*/ | |
class MyComponent extends React.Component { | |
async fetchData(){ | |
try{ | |
const res = await fetch( | |
'<endpoint>', { | |
method: 'get', |
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
{ | |
"Doc File": { | |
"prefix": "doc", | |
"body": [ | |
"/**", | |
" * File description...", | |
" * @author: Author Name <[email protected]>", | |
" * @since: $CURRENT_DATE/$CURRENT_MONTH/$CURRENT_YEAR", | |
" *", | |
" * Copyright $CURRENT_YEAR.", |
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
/** | |
* Javascript File | |
* @author: Aderbal Nunes <[email protected]> | |
* @since: 12/05/2020 | |
* | |
* | |
* props: { | |
* border: 2, | |
* borderColor: '#990099', | |
* borderStyle: 'solid', |
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
/** | |
* Password Input text | |
* @author: Aderbal Nunes <[email protected]> | |
* @since: 08/05/2020 | |
* | |
*/ | |
import React from "react" | |
import {FormControl,InputLabel,InputAdornment,Input} from '@material-ui/core'; | |
import {Visibility,VisibilityOff} from '@material-ui/icons'; |
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
/** | |
* Upload area component. Drag files or click to choose | |
* Aderbal Nunes <[email protected]> | |
*/ | |
import React, { PureComponent } from 'react'; | |
import {withStyles} from '@material-ui/styles'; | |
import PropTypes from 'prop-types'; | |
const styles = theme => ({ |
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
/** | |
* Checklist selector with Material-UI | |
* @author: Aderbal Nunes <[email protected]> | |
* @since: 02/11/2019 | |
* | |
* usage: | |
* <MyChecklist | |
* list={[ | |
* {label: 'Foo', isChecked: false, id: 23}, | |
* {label: 'Bar', isChecked: false, id: 44}, |
NewerOlder