Skip to content

Instantly share code, notes, and snippets.

View maneetgoyal's full-sized avatar
🎯
Focusing

Maneet Goyal maneetgoyal

🎯
Focusing
View GitHub Profile
@curran
curran / INDIA_DISTRICTS_TOPO.json
Last active February 26, 2024 10:50
India Geometries
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ppsirius
ppsirius / valiadion.js
Created July 10, 2019 08:06
aws s3 bucket name validation RegEx
{
bucketNameValidationRules: [
// rules from https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html
v => !!v || 'Name is required',
v => (v && /^[\a-z\d\.\-]*$/.test(v)) || 'The bucket name can contain only lower-case characters, numbers, periods, and dashes.',
v => (v && /^[\a-z\d]/.test(v)) || 'The bucket name must start with a lowercase letter or number.',
v => (v && !/\-$/.test(v)) || `The bucket name can't end with a dash`,
v => (v && !/\.+\./.test(v)) || `The bucket name can't have consecutive periods`,
v => (v && !/\-+\.$/.test(v)) || `The bucket name can't end with dash adjacent to period`,
v => (v && !/^(?:(?:^|\.)(?:2(?:5[0-5]|[0-4]\d)|1?\d?\d)){4}$/.test(v)) || `The bucket name can't be formatted as an IP address`,
@ithinkihaveacat
ithinkihaveacat / service-worker.d.ts
Last active April 18, 2024 16:49 — forked from tiernan/service-worker.d.ts
Typings for using the Service Worker API with TypeScript
/**
* Copyright (c) 2016, Tiernan Cridland
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
* granted, provided that the above copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR