Skip to content

Instantly share code, notes, and snippets.

View amizz's full-sized avatar

Amirul Zharfan Zalid amizz

View GitHub Profile
@amizz
amizz / k3s-ec2.md
Last active February 7, 2023 14:17
K3s EC2 Setup

EC2 Specification

1 x Master - Public IP: 1.0.0.1, Private IP: 10.0.0.1 (example)

1 x Agent/Node - Public IP: 1.0.0.2, Private IP: 10.0.0.2 (example)

Other Setup

Security group

  • 22, 80, 443, 6443, 2379, 2380, 10250
@amizz
amizz / lzw.js
Created March 23, 2019 05:59
LZW Compression in Javascript
/**
* LZW Compression
* LGPL License
*/
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
@amizz
amizz / domain.com
Created October 6, 2018 06:05
Nginx+Wordpress Subdirectory Configuration
server {
root /var/www/<domain>.com;
index index.php index.html index.htm index.nginx-debian.html;
server_name <domain>.com www.<domain>.com;
location / {
try_files $uri $uri/ =404;
}
@amizz
amizz / platform-specific-ns.md
Last active January 29, 2018 07:50
Platform Specific in Nativescript

Class/Function/TS file

someFunc.d.ts

  export function someFunc(): Promise<any>;

someFunc.<android/ios>.ts

@amizz
amizz / ns-google-services.md
Last active January 27, 2018 09:03
SOLUTION: NativeScript 'com.google.gms.google-services' failed to apply plugin
@amizz
amizz / nodejs-tcp-example.js
Created November 12, 2017 01:35 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@amizz
amizz / package.json
Created March 24, 2017 16:24 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",