Remove all dots except one in JavaScript with RegEx
'123.345..456456.00'.replace(/,/g,'.').replace(/[.](?!\d*$)/g,''); // 123345456456.00
/*! | |
Math.uuid.js (v1.4) | |
http://www.broofa.com | |
mailto:robert@broofa.com | |
Copyright (c) 2010 Robert Kieffer | |
Dual licensed under the MIT and GPL licenses. | |
*/ | |
/* |
Remove all dots except one in JavaScript with RegEx
'123.345..456456.00'.replace(/,/g,'.').replace(/[.](?!\d*$)/g,''); // 123345456456.00
********************************************************************************* | |
********************************************************************************* | |
// Checkbox | |
// Color Picker | |
// Number | |
// Dropdown | |
// Textfield | |
// Attach Image | |
// Textarea HTML | |
// Add Link |
// Run this in the F12 javascript console in chrome | |
// if a redirect happens, the page will pause | |
// this helps because chrome's network tab's | |
// "preserve log" seems to technically preserve the log | |
// but you can't actually LOOK at it... | |
// also the "replay xhr" feature does not work after reload | |
// even if you "preserve log". | |
window.addEventListener("beforeunload", function() { debugger; }, false) |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
// [START initialize_firebase_in_sw] | |
// Give the service worker access to Firebase Messaging. | |
// Note that you can only use Firebase Messaging here, other Firebase libraries | |
// are not available in the service worker. | |
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js'); | |
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js'); | |
// Initialize the Firebase app in the service worker by passing in the | |
// messagingSenderId. | |
firebase.initializeApp({ |
import * as Yup from "yup"; | |
const values = 0; | |
const msg = "value should be multiple of hundred"; | |
Yup.addMethod(Yup.number, "multipleOfHundred", function(msg) { | |
return this.test("test-name", msg, function(value) { | |
const { path, createError } = this; | |
return value % 100 === 0 && value !== 0; |
var exec = require('child_process').exec; | |
var targetBranch = process.argv[2] || "develop" | |
var title = process.argv[3] || "initial task" | |
var description = process.argv[4] || "initial task" | |
exec("git push origin HEAD \ | |
-o merge_request.create \ | |
-o merge_request.remove_source_branch \ | |
-o merge_request.title=" + title + " \ |