Skip to content

Instantly share code, notes, and snippets.

View dylansalim3's full-sized avatar
🎯
Focusing

Dylan Lim dylansalim3

🎯
Focusing
View GitHub Profile
@dylansalim3
dylansalim3 / data-intensive-application.md
Last active June 4, 2024 01:34
Design data intensive application

Designing a data-intensive application involves several considerations and components to ensure it can handle large volumes of data efficiently, process it accurately, and scale as needed. Here is a high-level overview of the key aspects and steps involved in designing such an application:

1. Define Requirements

  • Data Volume: Estimate the amount of data the application will need to handle.
  • Data Velocity: Determine the speed at which data will be ingested and processed.
  • Data Variety: Identify the types of data (structured, semi-structured, unstructured).
  • Use Cases: Clarify the main functionalities and use cases (e.g., real-time analytics, batch processing).

2. Choose the Right Architecture

@dylansalim3
dylansalim3 / apache.md
Created June 3, 2024 14:45
Comparison: Apache Beam vs. Apache Flink vs. Apache Spark vs. Apache Kafka

Comparison: Apache Beam vs. Apache Flink vs. Apache Spark vs. Apache Kafka

Apache Beam

Overview

  • Unified Model: Provides a unified programming model for both batch and stream processing.
  • Portability: Enables writing pipelines in multiple languages (Java, Python, Go) and executing them on various runners (Flink, Spark, Google Cloud Dataflow, etc.).
  • APIs and SDKs: Rich APIs for creating complex data processing tasks, supporting both bounded and unbounded data.

Use Cases

@dylansalim3
dylansalim3 / oh_my_zsh-plugin_setup.md
Last active June 25, 2024 14:11
Oh My ZSH plugin

Oh My Zsh Plugins

zsh-autocomplete vs zsh-autosuggestions comparison

  • zsh-autocomplete have more function, auto suggestions based on history, recommendations on certain commands and list all files when file related command used, able to select the correct commands from the recommendations
  • zsh-autosuggestions is just history based suggestions without list of commands to choose from

zsh-syntax-highlighting + zsh-autocomplete

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[RebuildIndexCursor]
-- Add the parameters for the stored procedure here
AS
BEGIN
import java.util.Date;
public class XirrEngine {
// settings that can be changes
private final double TOLERATE_RANGE = 0.001; // the smaller the amount, the more accurate. Use to check how near the result to equal 0
private final double GUESING_RATE = 0.1; // the bigger the amount, the more loop to try to calculate XIRR. Assume min ROI is 0.1
private final double DEFAULT_XIRR = -99999;
private final double DEFAULT_UNDEFINED_DOUBLE = 1e+100;
import java.util.Date;
public class XirrEngineBiSection {
// variables settings
private final double DAY_IN_YEAR = 365.0; // XIRR use default 365 in a year. No leap year consideration
private final double DEFAULT_XIRR = -99999;
private final int MAX_XIRR_TRY = 1000;
// main function
@dylansalim3
dylansalim3 / Tomcat 9 error page.md
Created November 12, 2021 07:03
Tomcat 9 error page
@dylansalim3
dylansalim3 / angular_webworker.md
Last active March 16, 2021 09:23
Web Worker Example in Angular

Web Worker in Angular

Example 1: Fibonacci Function in Angular

Create a web worker
ng generate web-worker webWorker

and move the fibonacci function into the file:

// webWorker-demo/src/app/webWorker.ts
function fibonacci(num) {
    if (num == 1 || num == 2) {
// Build docker file with a given tag
docker build -t {tag-name} {docker-location}
example -> docker build -t node-app-test .
//run docker in interactive mode
docker run -it -p {exposed-machine-port}:{application-port} {tag-name}
example -> docker build -t 9000:3000 node-app-text
// run container in the background/detach mode
docker run -d -p {exposed-machine-port}:{application-port} {tag-name}
@dylansalim3
dylansalim3 / create_bootable_iso.sh
Created November 22, 2020 16:37
Create bootable usb through Linux terminal (ONLY FOR LINUX ISO)
//check dev id
sudo fdisk -l
sample output:
Disk /dev/sdc: 14.3 GiB, 15376000000 bytes, 30031250 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
//Unmount the usb