Skip to content

Instantly share code, notes, and snippets.

View haandol's full-sized avatar
💭
ᕕ( ᐛ )ᕗ

haandol haandol

💭
ᕕ( ᐛ )ᕗ
View GitHub Profile
@haandol
haandol / image_splitter.py
Created June 12, 2025 05:58
vertical image split
#!/usr/bin/env python3
"""
이미지 분할 도구
위아래로 긴 이미지에서 중간 여백을 찾아 여러 개의 이미지로 분할합니다.
"""
import cv2
import numpy as np
import os
import argparse

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
@haandol
haandol / example.lua
Created September 21, 2024 07:38
copilot on lazyvim use tab to accept suggestion instead of enter, just like vscode
-- ~/.config/nvim/lua/plugins/cmp.lua
return {
{
"hrsh7th/nvim-cmp",
opts = function(_, opts)
local cmp = require("cmp")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm({ select = true })
@haandol
haandol / .vimrc
Created September 14, 2024 06:37 — forked from mendeza/.vimrc
Simple .vimrc or init.vim for nvim (neovim)
" (N)Vim Configuration File
" vim : place in $HOME/.vimrc
" nvim : place in $HOME/.config/nvim/init.vim
" $ ln -s $HOME/.config/nvim/init.vim $HOME/.vimrc
" General settings
" https://learnvimscriptthehardway.stevelosh.com/
" ---------------------------------------------------------------------------
" drop vi support - kept for vim compatibility but not needed for nvim
" Probably not needed with Vim 8+
"set nocompatible
@haandol
haandol / resize.sh
Last active April 6, 2023 04:27
script for resizing cloud9 volume size
#!/bin/bash
# Specify the desired volume size in GiB as a command line argument. If not specified, default to 20 GiB.
SIZE=64
# Get the ID of the environment host Amazon EC2 instance.
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/region)
# Get the ID of the Amazon EBS volume associated with the instance.
@haandol
haandol / how-to-use-aws-elasticsearch.md
Created April 15, 2021 07:47 — forked from simonw/how-to-use-aws-elasticsearch.md
How to use Amazon AWS Elasticsearch

How to use Amazon AWS Elasticsearch

The good news: you can get it running on the free tier (with a tiny instance).

The bad news: it's stuck on Elasticsearch 1.5.2 and dynamic scripting (Groovy) is disabled.

http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-limits.html

Authentication: the safest option is to create a brand new IAM user (using the tool at https://console.aws.amazon.com/iam/home?region=us-east-1 ) with its own access key and secret key. Then when you create the Elasticsearch instance you can paste in the following IAM string:

{
"type": "record",
"name": "Interactions",
"namespace": "com.amazonaws.personalize.schema",
"fields": [
{
"name": "USER_ID",
"type": "string"
},
{
@haandol
haandol / asyncio_boto3.py
Created April 3, 2020 03:25
asyncio boto3
import boto3
import asyncio
from concurrent.futures import ThreadPoolExecutor
client = boto3.client('lambda')
def call_lambda(*args, **kwargs):
return client.invoke(
FunctionName='helloworld',
)
# run below code after install cudnn, cudatoolkit
# !pip install tensorflow-gpu==2.1.0
# !conda install cudnn cudatoolkit -y
import tensorflow as tf
import numpy as np
from timeit import time
tf.debugging.set_log_device_placement(True)
tf.config.set_soft_device_placement(True)
@haandol
haandol / predictor.py
Created March 12, 2020 09:38
sagemaker predictor
import os
import json
from base64 import b64encode, b64decode
from matplotlib import pyplot as plt
import mxnet as mx
import sagemaker
from gluoncv.utils import download, viz
# 이미지를 로컬에 다운로드