Skip to content

Instantly share code, notes, and snippets.

@jungju
jungju / Makefile.codex-git-push
Created February 13, 2026 01:25
codex-git-push install commands and reusable Makefile snippet
# Reusable Makefile snippet for Codex-assisted commit split + push
GIT_PUSH_SCRIPT ?= scripts/codex-git-push.sh
TARGET_REMOTE ?= origin
TARGET_BRANCH ?= main
.PHONY: install-codex-git-push git-push git-push-any-branch
install-codex-git-push:
@mkdir -p scripts
@jungju
jungju / codex-git-push.sh
Created February 13, 2026 01:21
Portable Codex-assisted git commit split and push script
#!/usr/bin/env bash
set -euo pipefail
target_remote="${TARGET_REMOTE:-origin}"
target_branch="${TARGET_BRANCH:-main}"
codex_bin="${CODEX_BIN:-codex}"
require_branch_match="${REQUIRE_BRANCH_MATCH:-1}"
usage() {
cat <<'USAGE'
@jungju
jungju / requester.go
Created February 10, 2019 14:11
my web request
func Req(method string, url string, body interface{}, headers map[string]string, model interface{}) (int, error) {
var r *http.Request
fmt.Printf("Start request. %s", url)
if body == nil {
r, _ = http.NewRequest(method, url, nil)
} else {
bodyBytes, _ := json.Marshal(body)
r, _ = http.NewRequest(method, url, bytes.NewBuffer(bodyBytes))
r.Header.Add("Content-Type", "application/json")
@jungju
jungju / sqls.go
Last active December 17, 2018 13:11
sql helper
package db
import "fmt"
func MysqlDSN(user, password, host, port string) string {
return fmt.Sprintf("%s:%s@tcp(%s:%s)/?charset=utf8&parseTime=True&loc=Local",
user,
password,
host,
port,
@jungju
jungju / main.go
Created November 10, 2018 17:28
Sprintf benchmark
package main
import (
"fmt"
)
func SimpleStringSprintf() {
_ = fmt.Sprintf("Hello %v", "world")
}
@jungju
jungju / excel.vba
Last active October 8, 2018 05:48
Automatic Documentation of DB(SQL Server) Procedures (https://blog.jjgo.kr/100)
'https://blog.jjgo.kr/100
Sub GeneratorParamDoc()
Dim tableGr As Range
Dim writeCur As Range
Dim firstCur As Range
Dim rowCnt As Integer
Set writeCur = ActiveCell
Set firstCur = writeCur.Offset(0, -1)
rowCnt = 0
@jungju
jungju / gugudan.c
Created October 8, 2018 05:43
Hangul coding
//https://blog.jjgo.kr/71
#include<stdio.h>
#define 한줄의총커서 72
#define 엑스문자표시총행 16
#define 구구단한계산의글씨량 5
#define 구구단앞숫자 9
#define 구구단뒷숫자 9
@jungju
jungju / openapi.vb
Last active October 8, 2018 05:49
Using OpenAPI in VBA(https://blog.jjgo.kr/61)
Public Sub RequestTest()
Dim urlApi As String
Dim wb As Workbook
Dim getImageURL As String
Dim getImageURL2 As String
Dim oneCell As Range
Dim pic As PictureFormat
For Each oneCell In Selection
Dim se As Object
@jungju
jungju / gin_base_controller.go
Last active October 5, 2018 15:36
Increase readability by specifying Action as one line.
type behaviorFunc func()
type CrudController struct {
// TODO: Code it here.
}
func (ct *CrudController) Prepare() {
ct.BaseController.Prepare()
}
@jungju
jungju / git_change_author.sh
Created October 5, 2018 14:44
Specifically, you can fix all the wrong author names and emails for all branches and tags with this command
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"