sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
//Based on http://www.samliew.com/icval/ | |
function validateNRIC(str) { | |
if (str.length != 9) | |
return false; | |
str = str.toUpperCase(); | |
var i, | |
icArray = []; | |
for(i = 0; i < 9; i++) { |
// Note: only for modern browser | |
import axios from 'axios' | |
// helper function: generate a new file from base64 String | |
const dataURLtoFile = (dataurl, filename) => { | |
const arr = dataurl.split(',') | |
const mime = arr[0].match(/:(.*?);/)[1] | |
const bstr = atob(arr[1]) | |
let n = bstr.length | |
const u8arr = new Uint8Array(n) |
#! /usr/bin/env node | |
// I am ./bin/buildSitemap.js | |
const path = require('path') | |
const glob = require('glob') | |
const fs = require('fs') | |
const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com' | |
const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js') | |
const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml') |
'use strict'; | |
/*****************NATIVE forEACH*********************/ | |
Array.prototype.myEach = function(callback) { | |
for (var i = 0; i < this.length; i++) | |
callback(this[i], i, this); | |
}; | |
//tests |
<?php | |
/////////////////////////////////////////////////// | |
// STEP 1 - CREATE CLASS THAT WILL BE USED GLOBALY | |
/////////////////////////////////////////////////// | |
namespace App\MyApp; | |
class MyApp { | |
public function sayHello($data = []) | |
{ | |
echo "Hello World from Facade!"; | |
} |
<!DOCTYPE html> | |
<html class="no-js"> | |
<head> | |
<!-- stuff --> | |
<!-- FOUC fix --> | |
<style type="text/css"> | |
.no-js {display: none;} | |
</style> | |
</head> |
#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.
Run the following commands in sequence.
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip