Skip to content

Instantly share code, notes, and snippets.

View richardneililagan's full-sized avatar
🚀

Richard Neil Ilagan richardneililagan

🚀
View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@Avaq
Avaq / combinators.js
Last active September 26, 2024 18:53
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@mikeal
mikeal / count-npm-dependencies.js
Created February 16, 2016 00:49
Calculate the average number of dependencies in all modules on npm.
var request = require('request')
, JSONStream = require('JSONStream')
, deps = []
request('https://skimdb.npmjs.com/registry/_all_docs?include_docs=true')
.pipe(JSONStream.parse('rows.*.doc'))
.on('data', function (obj) {
// project against outdated or broken package.json
if (!obj['dist-tags']) return
if (!obj['dist-tags'].latest) return
@adrianhall
adrianhall / AppSyncAPI.yaml
Last active September 25, 2024 01:43
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'