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
| #!/bin/bash | |
| # The name of your main branch e.g. main, trunk | |
| MAIN_BRANCH='main' | |
| # The prefix added to your JIRA tickets | |
| JIRA_PREFIX='JIRA' | |
| # The url of your JIRA | |
| JIRA_URL='https://example.atlassian.net' |
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
| delete-merged() { | |
| git remote prune origin; git fetch -p; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -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
| window.MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; | |
| if(window.MutationObserver) { | |
| const observer = new MutationObserver(mutations => { | |
| mutations.forEach(mutation => { | |
| console.log(mutation.attributeName) | |
| }); | |
| }); | |
| observer.observe(document.getElementById('#my-element'), { attributes: true }); |
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
| export function calculate_distance(latLng_a, latLng_b) | |
| { | |
| const radius = 6371; | |
| const lat_a = latLng_a.split(',')[0]; | |
| const lng_a = latLng_a.split(',')[1]; | |
| const lat_b = latLng_b.split(',')[0]; | |
| const lng_b = latLng_b.split(',')[1]; | |
| const dLat = ConvertToRadians(lat_a - lat_b); | |
| const dLon = ConvertToRadians(lng_a - lng_b); |
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
| /* | |
| Props: | |
| $property: Any CSS that accepts calc(), viewport units and pixels, ie. Most properties… height/width/padding/font-size etc. | |
| $min: The minimum size. | |
| $max: The maximum size. | |
| $start: $min will be used at any resolution lower than this. | |
| $end: $max value will be used at any resolution higher than this. | |
| $clip: When set to false, this disables clipping with the $start and $end properties. | |
| $clipAtStart: When set to false, this disables clipping with the $start property. | |
| $clipAtEnd: When set to false, this disables clipping with the $end property. |
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
| /* one item */ | |
| li:first-child:nth-last-child(1) { | |
| width: 100%; | |
| } | |
| /* two items */ | |
| li:first-child:nth-last-child(2), | |
| li:first-child:nth-last-child(2) ~ li { | |
| width: 50%; | |
| } |
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
| export default function ValidateUKPhone(number) { | |
| const errorMessages = [ | |
| "Please enter a UK telephone number without the country code.", | |
| "UK telephone numbers should contain 10 or 11 digits.", | |
| "The telephone number should start with a 0.", | |
| "The telephone number is either invalid or inappropriate." | |
| ]; | |
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
| function hexToRgb(hex) { | |
| // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") | |
| const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; | |
| hex = hex.replace(shorthandRegex, (m, r, g, b) => { | |
| return r + r + g + g + b + b; | |
| }); | |
| const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
| return result ? { | |
| r: parseInt(result[1], 16), |
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
| (function () { | |
| var cache = {}; | |
| this.tmpl = function tmpl(str, data) { | |
| var fn = !/\W/.test(str) ? | |
| cache[str] = cache[str] || | |
| tmpl(document.getElementById(str).innerHTML) : | |
| new Function("obj", | |
| "var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('" + | |
| str.replace(/[\r\t\n]/g, " ") |
NewerOlder