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 { Injectable } from '@angular/core'; | |
| @Injectable({ | |
| providedIn: 'root', | |
| }) | |
| export class ReloadService { | |
| private storageKey = 'isPageReloaded'; | |
| reload(): void { | |
| if (!sessionStorage.getItem(this.storageKey)) { |
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
| numeric only | |
| /^\d+$/ | |
| alphanumeric, dash and underscore with space | |
| /^[a-z\d\-_\s]+$/i | |
| detect non alphanumeric chars | |
| /[^a-zA-Z\d]/ |
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 { | |
| View, | |
| Text, | |
| StyleSheet, | |
| Platform, | |
| Button, | |
| ScrollView, | |
| InputAccessoryView, | |
| KeyboardAvoidingView, |
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 { | |
| HeaderHeightContext | |
| } from "@react-navigation/stack"; < | |
| HeaderHeightContext.Consumer > { | |
| headerHeight => ( < | |
| KeyboardAvoidingView { | |
| ...(Platform.OS === "ios" ? { | |
| behavior: "padding" | |
| } : {}) | |
| } |
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
| gem "devise_custom_authenticatable" |
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
| /** | |
| * Masks Input with thousand separator | |
| * | |
| * @param {string} amount - Amount | |
| * @return {string} Masked Amount | |
| * | |
| * @example | |
| * formatAmount("1000") // 1,000 | |
| */ | |
| export function formatAmount(amount) { |
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
| Open psql terminal | |
| psql -U postgres -h localhost | |
| Create database | |
| create database dbname; | |
| List databases | |
| \l | |
| Create user to work with db create |
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 { Field } from "redux-form"; | |
| import PropTypes from "prop-types"; | |
| import FormControlLabel from "@material-ui/core/FormControlLabel"; | |
| import Checkbox from "@material-ui/core/Checkbox"; | |
| export default class CheckboxGroup extends Component { | |
| static propTypes = { | |
| options: PropTypes.arrayOf( | |
| PropTypes.shape({ |
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
| knex init | |
| edit knexfile.js | |
| in migration object, add directory property: | |
| with 'db/migrations' |
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
| # Development | |
| DEV_DB_USERNAME=root | |
| DEV_DB_PASSWORD=yourdbpassword | |
| DEV_DB_NAME=apollo_development | |
| DEV_DB_HOSTNAME=localhost | |
| # Test | |
| TEST_DB_USERNAME=root | |
| TEST_DB_PASSWORD=yourdbpassword |
NewerOlder