brew services start postgresbrew services stop postgres| ;(function addSecuritySeals(element, $) { | |
| const styleRules = ` | |
| #version-2 #confirm-order-step-bottom { width: auto; } | |
| #version-2 #confirm-order-step-bottom .step { margin: 3px; } | |
| .seals { | |
| display: flex; | |
| justify-content: space-between; | |
| } |
| ;(function companyNameFromEmail(emailElement, companyElement, $) { | |
| const DEBOUNCE_TIME = 250 | |
| const COMPANY_REGEX = /(?<=@).+(?=\.)/ | |
| const $companyField = $(companyElement) | |
| const $companyParagraph = $companyField.closest('p') | |
| $companyParagraph.hide() | |
| const toTitleCase = (string) => ( |
| const debounce = (func, wait, immediate) => { | |
| let timeout | |
| return function() { | |
| const context = this | |
| const args = arguments | |
| const later = () => { | |
| timeout = null | |
| if(!immediate) func.apply(context, args) |
| // Regex to get any repeated numbers in a string | |
| var repeatedNumber = /(\d)\d*\1/ | |
| /* | |
| (\d) -> first group (a number in this case) that will be checked by \1 | |
| \d* -> any quantity of digits between the number to be checked and the "checker" | |
| \1 -> same stuff that is in the 1st group (in this case, a digit = \d) | |
| e.g | |
| 00: |
| function BrowserDetection() { | |
| //Check if browser is IE | |
| if (navigator.userAgent.search('MSIE') !== -1) { | |
| console.log('IE'); | |
| } | |
| //Check if browser is Chrome | |
| else if (navigator.userAgent.search('Chrome') !== -1) { | |
| console.log('Chrome'); | |
| } | |
| //Check if browser is Firefox |
| // =================================== | |
| // ============ Slide ================ | |
| // =================================== | |
| /* | |
| <div class"i-slides"> | |
| <div class="i-slide"></div> | |
| <div class="i-slide"></div> | |
| <div class="i-slide"></div> | |
| ... |
| # Delete branches that are already merged (but master/development/stage) | |
| git branch --merged | egrep -v "(^\*|master|development|stage)" | xargs git branch -d | |
| # Delete all local branches (but master/development/stage) | |
| git branch | egrep -v "(^\*|master|development|stage)" | xargs git branch -D |
| import { useEffect, useState } from 'react' | |
| const appId = process.env.REACT_APP_FACEBOOK_APP_ID || 'dev_app_id' | |
| const useFacebook = () => { | |
| const [fbSdkLoaded, setFbSdkLoaded] = useState(false) | |
| useEffect(() => { | |
| setupFacebook() | |
| // eslint-disable-next-line react-hooks/exhaustive-deps |