Skip to content

Instantly share code, notes, and snippets.

View go-zen-chu's full-sized avatar
😎
Always be kind, for everyone is fighting a hard battle

Akira Masuda go-zen-chu

😎
Always be kind, for everyone is fighting a hard battle
View GitHub Profile
@go-zen-chu
go-zen-chu / swap_colon_semicolon.ahk
Last active February 1, 2025 12:03
Swap colon and semicolon key with AutoHotkey v2
#Requires AutoHotkey v2.0
; swap semicolon & colon for vim
*vkBA::{
If (GetKeyState("Shift")){
Send "`;"
}
else {
Send ":"
}
}
@go-zen-chu
go-zen-chu / download_checksum_release.sh
Last active February 26, 2023 08:18
Download github release with tgz, untar then checksum. (For using in CI etc)
#!/usr/bin/env bash
release_url=$1
checksum_url=$2
binary_name=$3
cleanup=${4:-true}
function checksum() {
release_name=$1
checksum_name=$2
cs="no such checksum"
@go-zen-chu
go-zen-chu / Makefile
Last active February 23, 2023 08:23
lint yaml with makefile for CI (Run `make lint` in CI should lint all files in your repo)
DOCKER_RUN := docker run --rm -v $(shell pwd):/src -w /src
NODE_IMAGE := docker.io/node:18
NPM := $(DOCKER_RUN) $(NODE_IMAGE) npm
lint:
$(NPM) install
$(NPM) run lint
@go-zen-chu
go-zen-chu / replace.go
Created August 21, 2022 15:39
argocd-vault-plugin : replace <placeholder> with environment variables
package main
import (
"bufio"
"fmt"
"os"
"regexp"
"strconv"
"strings"
)
@go-zen-chu
go-zen-chu / panic.go
Created August 11, 2022 13:43
investigate golang panic
package main
func main() {
panic("test panic")
}
@go-zen-chu
go-zen-chu / etc_hosts_repository.go
Last active November 19, 2023 09:14
golang overwrite /etc/hosts to values get from config server
package dns
import (
"fmt"
"io/ioutil"
ddns "github.com/go-zen-chu/customdns/domain/dns"
)
type etcHostsRepository struct {
@go-zen-chu
go-zen-chu / install_util.sh
Last active September 16, 2019 08:29
shell snippet for installation
# returns 0 if file should be written
function confirm_overwrite() {
declare file=$1
if [[ -f "${file}" ]] ; then
read -r -p "${file} exists. overwrite? [y/n]" -n 1 response
echo ""
case "${response}" in
y|Y ) return 0 ;;
*) echo "abort overwrite"; return 1 ;;
esac
@go-zen-chu
go-zen-chu / get_jira_tsv.py
Created July 15, 2019 13:51
create tsv of tickets from jira
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import pytz
import pprint
from jira import JIRA
from datetime import datetime
@go-zen-chu
go-zen-chu / list_github_repo_issues.go
Created March 2, 2019 09:16
Sample Code for listing github issues in repo
package main
import (
"context"
"flag"
"github.com/google/go-github/v24/github"
"golang.org/x/oauth2"
"log"
"net/url"
)
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->