Skip to content

Instantly share code, notes, and snippets.

View irfansofyana's full-sized avatar
🎯
Focusing

Irfan Sofyana Putra irfansofyana

🎯
Focusing
View GitHub Profile
@irfansofyana
irfansofyana / sync_gsheets_app_script.js
Last active November 4, 2022 03:02
Template code to sync values and formulas between two Google Sheets using App Script
View sync_gsheets_app_script.js
function copySheets() {
sheetIDsToUpdate = [
// [sourceID, destID]
["source_google_sheets_id", "dest_google_sheets_id"]
]
for (let i = 0; i < sheetIDsToUpdate.length; i++) {
sourceID = sheetIDsToUpdate[i][0]
destID = sheetIDsToUpdate[i][0]
View docker-compose.yaml
version: '3.7'
services :
postgres:
image: postgres:latest
volumes:
- infra-postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
View docker-compose-kafka.yaml
version: "3"
services:
zookeeper:
image: 'bitnami/zookeeper:latest'
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: 'bitnami/kafka:latest'
@irfansofyana
irfansofyana / init.vim
Last active January 9, 2022 14:05
neovim config
View init.vim
:set number
:set autoindent
:set tabstop=4
:set shiftwidth=4
:set smarttab
:set softtabstop=4
:set mouse=a
call plug#begin()
@irfansofyana
irfansofyana / abstract_factory.java
Last active January 7, 2021 15:11
Example of non-executable code for creational design pattern
View abstract_factory.java
// Formally, the abstract factory pattern is defined as defining an interface to create families of related or dependent objects
// without specifying their concrete classes.
public interface IEngine {
void start();
}
public class F16Engine implements IEngine {
@Override
@irfansofyana
irfansofyana / BigInt.cpp
Created August 4, 2019 03:53 — forked from ar-pa/BigInt.cpp
bignum class for C++
View BigInt.cpp
/*
######################################################################
####################### THE BIG INT ##########################
*/
const int base = 1000000000;
const int base_digits = 9;
struct bigint {
vector<int> a;
int sign;
/*<arpa>*/