It's a fairly common complaint that after enabling github two factor authentication that command line utilities
stop working. The underlying issue is command line utilities send your username and password with each request
to github, using two factor authentication disables github from accepting just your username and password, so your
command line utilities such as git
appear to stop working. Github will still accept a personal access token instead
of your password however.
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
CREATE TABLE `country` ( | |
`iso` char(3) NOT NULL DEFAULT '', | |
`name` varchar(80) NOT NULL DEFAULT '', | |
`nice_name` varchar(80) NOT NULL DEFAULT '', | |
`iso3` char(3) DEFAULT NULL, | |
`num_code` smallint(6) DEFAULT NULL, | |
`phone_code` int(5) NOT NULL, | |
`created_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
`updated_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
PRIMARY KEY (`iso`) |
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
#!/bin/bash | |
# edit variable values here | |
NODE_VERSION="8.4.0" | |
###### DO NOT EDIT FROM HERE ONWARDS ###### | |
# update centos | |
sudo yum -y update | |
# install development tools |
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
//Create a local writestream | |
var wstream = fs.createWriteStream(tempFile, { encoding: 'binary' }); | |
//Data has been written successfully | |
wstream.on('finish', function() { | |
fs.readFile(tempFile, function (err, fsData) { | |
// trigger upload to S3 function | |
uploadToS3(req, { | |
s3Path: s3Path, | |
contentType: data.mime_type, |
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
// Got the request and response messages via Xero API History on API calls. | |
// Request message | |
{"BankTransactions":[{"Type":"RECEIVE","Contact":{"ContactID":"fc6cb299-ea76-4bc9-881d-bbd71db9a60f","ContactStatus":"ACTIVE","Name":"First Thai Food","EmailAddress":"","BankAccountDetails":"","Addresses":[{"City":"","Region":"","PostalCode":"","Country":"","AddressType":"STREET"},{"City":"","Region":"","PostalCode":"","Country":"","AddressType":"POBOX"}],"Phones":[{"PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":"","PhoneType":"DEFAULT"},{"PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":"","PhoneType":"DDI"},{"PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":"","PhoneType":"FAX"},{"PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":"","PhoneType":"MOBILE"}],"DefaultCurrency":"SGD"},"LineItems":[{"Description":"Employee lunch","Quantity":1,"UnitAmount":32,"AccountCode":"461","TaxType":"INPUT","TaxAmount":2.09,"LineAmount":32}],"BankAccount":{"AccountID":"617b2867-3e64-45ed-a40b-e6dd72106def"}," |
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
USD|United States Dollars | |
EUR|Euro | |
GBP|United Kingdom Pounds | |
DZD|Algeria Dinars | |
ARP|Argentina Pesos | |
AUD|Australia Dollars | |
ATS|Austria Schillings | |
BSD|Bahamas Dollars | |
BBD|Barbados Dollars | |
BEF|Belgium Francs |
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.
- No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
- VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
- VPC with NAT, The best of both worlds, AWS services and web.
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
[ | |
{ "name": "Afghanistan", "code": "AF" }, | |
{ "name": "Albania", "code": "AL" }, | |
{ "name": "Algeria", "code": "DZ" }, | |
{ "name": "American Samoa", "code": "AS" }, | |
{ "name": "Andorra", "code": "AD" }, | |
{ "name": "Angola", "code": "AO" }, | |
{ "name": "Anguilla", "code": "AI" }, | |
{ "name": "Antarctica", "code": "AQ" }, | |
{ "name": "Antigua and Barbuda", "code": "AG" }, |
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
/** | |
* 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', |