https://facebook.github.io/react/docs/tutorial.html
##If you finish up and want to try something else:
| const hasTouchscreen = () => { | |
| const mobileDevice = (/Android|iPhone|iPad|iPod/i).test(navigator.userAgent || navigator.vendor || window.opera) | |
| const onTouchEnd = ('ontouchend' in document.documentElement) | |
| return (mobileDevice && onTouchEnd) | |
| } |
| <?php | |
| //* Do NOT include the opening php tag shown above. Copy the code shown below. | |
| //required plugins: code snippets, caldera forms, caldera forms run action | |
| add_action('consult_req_submitted', 'consult_req_submitted_sync_hubspot'); | |
| function consult_req_submitted_sync_hubspot( $data ){ | |
| $hubspot_api_key = 'ffffffff-27a0-4591-9b68-27d4bb31ed76'; | |
| $hubspot_list_id = '1'; //optional |
https://facebook.github.io/react/docs/tutorial.html
##If you finish up and want to try something else:
| ## Pre-requisite: You have to know your last commit message from your deleted branch. | |
| git reflog | |
| # Search for message in the list | |
| # a901eda HEAD@{18}: commit: <last commit message> | |
| # Now you have two options, either checkout revision or HEAD | |
| git checkout a901eda | |
| # Or | |
| git checkout HEAD@{18} |
| const debounce = function(fn, duration) { | |
| let timeout = null | |
| return (...args) => { | |
| clearTimeout(timeout) | |
| timeout = setTimeout(() => fn(...args), duration) |
| const select = (query, elem = null) => { | |
| elem = (elem==null ? document : elem) | |
| let elems = elem.querySelectorAll(query) | |
| if (elems==null) return [] | |
| else return Array.prototype.slice.call(elems, 0) | |
| } |
| const toggler = (initState) => { | |
| initState = initState!==false | |
| let state = initState | |
| return { | |
| get : () => state, | |
| reset : () => state = initState, | |
| toggle : () => state = !state, |
| const counter = (min, max, initial) => { | |
| let index = initial - min | |
| let length = max - min + 1 | |
| return (modifier = 0) => { | |
| index = (index + modifier) % length | |
| if (index>=0) index = 0 + index |
| const limit = (min, max, num) => Math.min(Math.max(num, min), max) |
| hbspt.forms.create({ | |
| portalId: '', //Your portal ID | |
| formId: '', // Your form ID | |
| css: '', | |
| onFormReady: function(form, ctx) { | |
| form.parents('.hbspt-form:first').on('DOMSubtreeModified', function() { | |
| var hsForm = $(this); | |
| if(hsForm.find('.submitted-message').length) { | |
| //Your code. | |
| } |