- Get reCAPTCHA key and secret from Google site, https://www.google.com/recaptcha/admin/create
- Store your key and secret in a safe place
- Code public/index.html (update {{KEY}})
- Code server.js (update {{SECRET}})
- Run your server
$ npm i $ node server.js
- Open browser, http://localhost:3000, and click "Submit"
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
function calculatePolygonArea(coordinates) { | |
// Check if the polygon is closed (first and last points should match) | |
const first = coordinates[0]; | |
const last = coordinates[coordinates.length - 1]; | |
if (first[0] !== last[0] || first[1] !== last[1]) { | |
coordinates.push([...first]); // Close the polygon if not already closed | |
} | |
// Calculate average latitude for longitude scaling | |
const latitudes = coordinates.map(coord => coord[1]); |
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
.draggable-console { | |
z-index: 4; | |
position: absolute; | |
background: #FFF; | |
border: 1px solid #ccc; | |
font-size: .75rem; | |
&.collapsed { | |
> :not(.title) /* .console */ { | |
display: none; |
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
.dialog-modal { | |
border: 0; | |
border-radius: 0.5rem; | |
width: 50%; | |
height: 75%; | |
padding: 0; | |
overflow: auto; | |
background-color: #f6f6f6; | |
&::backdrop { |
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 structuredClone from "@ungap/structured-clone"; | |
export const UndoRedo = { | |
debounceMs: 300, | |
timeout: 0, | |
undoStack: [], | |
redoStack: [], | |
reset(item) { |
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
! function(t, e) { | |
'object' == typeof exports && 'object' == typeof module ? module.exports = e() : 'function' == typeof define && define.amd ? define([], e) : 'object' == typeof exports ? exports["grapesjs-plugin-grid"] = e() : t["grapesjs-plugin-grid"] = e() | |
}('undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : this, (() => (() => { | |
"use strict"; | |
var t = { | |
d: (e, n) => { | |
for (var o in n) t.o(n, o) && !t.o(e, o) && Object.defineProperty(e, o, { | |
enumerable: !0, | |
get: n[o] | |
}) |
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
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
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
{ | |
"countries": [ | |
{ | |
"name": "Afghanistan", | |
"code": "AF" | |
}, | |
{ | |
"name": "Åland Islands", | |
"code": "AX" | |
}, |
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
// yyyy - full uyear, e.g. 1969 | |
// mm - two digit month, e.g. 01, 12 | |
// mmm - e.g. Jan, Feb, Mar | |
// dd - two digit date e.g. 01, 31 | |
// ddd - 1st, 2nd 21st | |
// www - e.g. Mon, Tue, Wed... | |
function formatDate(date, format = 'yyyy-mm-dd') { // mm/dd/yyyy, www MMM DDD YYYY | |
const day = date.getDate(); | |
const weekdays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; | |
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Form controls and validation</title> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
</head> | |
<body> | |
<form onsubmit="handleSubmit(event)" noValidate> <!-- noValidate --> |
NewerOlder