Skip to content

Instantly share code, notes, and snippets.

View marantz's full-sized avatar

DongHan Kim marantz

  • Polaris AI
  • South Korea, Seoul
  • 21:11 (UTC -12:00)
  • X @zaaik
View GitHub Profile
@marantz
marantz / .zshrc
Created July 3, 2026 22:56
~/.zshrc - marantz's zsh config
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
@marantz
marantz / brew-setup.sh
Created July 3, 2026 22:33
macOS Homebrew 환경 재현 스크립트 (2026-07-04 기준)
#!/usr/bin/env bash
# brew-setup.sh — 새 Mac에 Homebrew 환경을 재현하는 설치 스크립트
# 생성일: 2026-07-04 (marantz@gmail.com 의 환경 기준)
set -euo pipefail
# ──────────────────────────────────────────────
# 색상 출력 헬퍼
# ──────────────────────────────────────────────
GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; NC='\033[0m'
@marantz
marantz / AttributeChange.js
Created September 1, 2021 01:32
Document Attribute Change
[
{
"_id": 1,
"texts": [
{ "language": "english", "text": "hello" },
{ "language": "german", "text": "hallo" },
{ "language": "french", "text": "bonjour" }
]
}, …
]
@marantz
marantz / MaintenanceSyncApplication.java
Created June 29, 2021 00:32
MongoDB Change Streams Java Spring Boot Application Sample
package org.project;
import com.mongodb.ConnectionString;
import com.mongodb.MongoClientSettings;
import com.mongodb.client.*;
import com.mongodb.client.model.Filters;
import com.mongodb.client.model.UpdateOptions;
import com.mongodb.client.model.changestream.ChangeStreamDocument;
import com.mongodb.client.model.changestream.FullDocument;
import com.mongodb.client.result.UpdateResult;
@marantz
marantz / Makefile
Created December 26, 2020 02:41
Makefile
appname := myapp
CXX := g++
CXXFLAGS := -Wall -g
srcfiles := $(shell find . -maxdepth 1 -name "*.cpp")
objects := $(patsubst %.cpp, %.o, $(srcfiles))
all: $(appname)
@marantz
marantz / oracle_json_func.sql
Last active July 27, 2020 23:03
Oracle SQL to json
1) json_object
2) json_objectagg
3) json_array
4) json_arrayagg
SELECT JSON_OBJECT (
KEY 'deptno' IS d.department_id FORMAT JSON,
KEY 'deptname' IS d.department_name FORMAT JSON
) "Department Objects"
FROM departments d
#!/bin/sh
export MONGODB_HOME=/opt/mongodb
export MONGODB_BIN=${MONGODB_HOME}/bin
export MONGO="${MONGODB_BIN}/mongo --host centos --port 27018 --quiet"
export MONGODUMP="${MONGODB_BIN}/mongodump --host centos --port 27018"
export BACKUP_DIR=${MONGODB_HOME}/data/backup
echo "BACKUP DATABASE"
_DB_LIST=(`echo "show dbs" | $MONGO | grep -v admin | grep -v config | awk {'print $1'}`)
@marantz
marantz / aggregation_grouping_basic.js
Created April 27, 2020 16:07
MongoDB Aggregation Grouping Basic
// sample
db.test_collection.insert({field01:"A", field02:"a", field03:1})
db.test_collection.insert({field01:"A", field02:"a", field03:2})
db.test_collection.insert({field01:"A", field02:"a", field03:3})
/*
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } },
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } },
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } },
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } },
@marantz
marantz / mongorc.js
Created March 8, 2020 04:12
MongoDB Add User Client Source
// Remove Duplicates
function removeDuplicates(array) {
return array.sort().filter((a, b) => array.indexOf(a) === b)
};
// Add CIDR Address on User
addUserClientSource = function(user,dbname,cidr) {
var nsAdmin = "admin." + user;
var res = db.system.users.aggregate([
{$match:{"_id" : nsAdmin, "user" : user, "db" : dbname}},
CFLAGS=-stdlib=libc++ pip install jpype1-py3
tar -xzvf mecab-0.996-ko-0.9.2.tar.gz
cd mecab-0.996-ko-0.9.2
./configure
make;sudo make install
MACOSX_DEPLOYMENT_TARGET=10.15 pip install mecab
python