This file contains 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 { ReactElement } from 'react' | |
import { ReactComponentLike } from 'prop-types' | |
type Meta = { | |
parent: { [key: string]: any } | |
path: string[] | |
document: { [key: string]: any } | |
} | |
type CustomRuleCallback = (field: any, meta: Meta) => true | string | Promise<true | string> |
This file contains 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
pipelines: | |
default: | |
- step: | |
name: build and publish docker image | |
services: | |
- docker | |
caches: | |
- docker | |
script: | |
- docker build -t $APP_NAME . |
This file contains 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 isValidKennitala(kt) { | |
// Trim and remove optional "-" or " " separators | |
kt = kt.trim().replace(/\s|-/, ''); | |
// Alternatively only allow separator as 7th character | |
// kt = kt.replace(/^(.{6})[\s-]/, '$1'); | |
// Must be 10 digits, ending in either 0 or 9 (note Y2.1k problem!) | |
if ( kt.length !== 10 && !/^\d{9}[90]$/.test(kt) ) { | |
return false; | |
} |
This file contains 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
// url is the link for the form view page | |
// data is the name attribute of the field | |
$.ajax({ | |
url: "https://docs.google.com/forms/d/1iqMixtVq4O0AFvYCZHbGerigi1G5Qb3XthXZX9VpNtk/formResponse", | |
data: { "entry.1679407376": field1}, | |
type: "POST", | |
dataType: "xml", | |
statusCode: { |
This file contains 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
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |