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
mkdir project_dir | |
cd project_dir | |
python3 -m venv env | |
// activate the virtual env | |
source env/bin/activate | |
pip list // to list the dependencies for project | |
pip install <dependency_name> | |
pip freeze > requirements.txt (can be any name) | |
// to install dependency from file |
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 from 'react'; | |
const App = () => { | |
const [timer, setTimer] = React.useState(0); | |
const intervalRef = React.useRef<null | number>(null); | |
function timer_handler() { | |
setTimer(timer => timer + 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
// Array of timesheet for the selected week. from = "02-02-2020", to = "08-02-2020" | |
const timeSheetData = [ | |
{ | |
id: "P-011", | |
taskId: "T-011", | |
// more fields such as taskname, projectname and more | |
timeEntriesForWeek: { | |
"02-02-2020": 1, | |
"03-02-2020": 4, |
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
const weeklyTimeSheetData = [ | |
{ | |
id: "P-011", | |
taskId: "T-011", | |
timeEntriesForWeek: {} | |
}, | |
{ | |
id: "P-012", | |
taskId: "T-70", | |
timeEntriesForWeek: {} |
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
const { editable, editableOpts } = this.props; | |
return ( | |
<Child {...(editable && { editable: editableOpts } )} /> | |
); |
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
content: item => ( | |
<> | |
<ContentWrapper> | |
<LinkWrapper | |
to={{ | |
pathname: `/settings/employees/${item.companyId}/grants/${ | |
item.id | |
}`, | |
state: { | |
companyName: item.name |
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
const getInitialValues = props => { | |
const {company} = props | |
const filteredData = {...company} | |
if (company && company.companyCategory) { | |
const { | |
companyCategory: {id}, | |
} = company | |
delete filteredData.companyCategory | |
filteredData.companyCategoryId = parseInt(id, 10) | |
} |
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
/* eslint-disable jsx-a11y/label-has-for */ | |
import React from 'react'; | |
import { capitalizeFirstLetters } from 'Utils'; | |
type Props = { | |
name: string, | |
label: string, | |
options: Object, | |
idKey: string, | |
nameKey: 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
console.log([false, null, 2, 0, undefined].filter(Boolean)); | |
const isRequired = () => { throw new Error('param is required'); }; | |
const hello = (name = isRequired()) => { console.log(`hello ${name}`) }; |
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
=> #<Client:0x00007fc6b1d7f0f8 | |
id: 35, | |
company_name: "Moneyballok", | |
company_url: "www.mvnbasfi.com", | |
company_email: "[email protected]", | |
company_size: nil, | |
phone_number: nil, | |
fax: nil, | |
address: nil, | |
address_alt: nil, |
NewerOlder