Skip to content

Instantly share code, notes, and snippets.

View mervintankw's full-sized avatar

Mervin Tan Kok Wei mervintankw

View GitHub Profile
@mervintankw
mervintankw / validateUEN.js
Last active July 8, 2024 13:41
validates that UEN (Unique Entity Number) number is valid based on https://www.uen.gov.sg/ueninternet/faces/pages/admin/aboutUEN.jspx
/**
* validates UEN of businesses in Singapore
* https://www.uen.gov.sg/ueninternet/faces/pages/admin/aboutUEN.jspx
* @param {string} uen
* @returns {boolean}
*/
function validateUEN (uen) {
var debug = true;
const entityTypeIndicator = [
'LP', 'LL', 'FC', 'PF', 'RF', 'MQ', 'MM', 'NB', 'CC', 'CS', 'MB', 'FM', 'GS', 'GA',

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@AmrMekkawy
AmrMekkawy / currency-dropdown-list.html
Last active April 8, 2023 15:03
Currency HTML "select" element (dropdown list)
<select name="">
<option value="USD" selected="selected">United States Dollars</option>
<option value="EUR">Euro</option>
<option value="GBP">United Kingdom Pounds</option>
<option value="DZD">Algeria Dinars</option>
<option value="ARP">Argentina Pesos</option>
<option value="AUD">Australia Dollars</option>
<option value="ATS">Austria Schillings</option>
<option value="BSD">Bahamas Dollars</option>
<option value="BBD">Barbados Dollars</option>