Skip to content

Instantly share code, notes, and snippets.

View roeniss's full-sized avatar
🌊
파도가 철썩 철썩 철썩

Roeniss Moon roeniss

🌊
파도가 철썩 철썩 철썩
View GitHub Profile
@roeniss
roeniss / get_all_problem_level.sh
Created September 9, 2024 08:51
solved ac api usage
#!/bin/bash
echo '' > problemToLevel.csv
result=$(seq 1 35000 | paste -sd "," - | sed 's/\([^,]*,\)\{100\}/&\n/g')
IFS=$'\n' read -rd '' -a number_array <<< "$result"
for i in "${!number_array[@]}"; do
number_array[$i]=${number_array[$i]%?} # remove last comma
@roeniss
roeniss / checkApplyHome.sh
Last active May 23, 2024 07:57
청약홈 달력 조회 curl
#!/usr/bin/env bash
# [note]
# error message 'xargs: unterminated quote' is ignorable.
# [workflow]
# 1. daily execute the command
# 2. if something shows up, apply via web browser
# [RCEPT_SE]
@roeniss
roeniss / pr_with_the_file_on_every_repo.sh
Last active January 23, 2024 11:45
Script for adding same file to all repositories in a organization as a pull request (works in 2024)
#!/usr/bin/env bash
#
# How it works
# - clone all repositories using `gh-cli`
# - copy the prepared file to one repo among them
# - git add, git commit, git push, gh pr create
# - Repeat above two steps for other repos
#
@roeniss
roeniss / convert_ktStr_to_json.sh
Last active September 14, 2023 18:33
convert kotlin data class toString into json in terminal
# motivation: it's not easy to look println(dataClass)
#
# example:
# input: Movie(title=Inception, year=2010, director=Person(firstName=Christopher, lastName=Nolan))
# output: {
# "title": "Inception",
# "year": "2010",
# "director": {
# "firstName": "Christopher",
# "lastName": "Nolan"
@roeniss
roeniss / add_bookmark.sh
Last active February 26, 2024 07:15
Add a bookmark to Chrome browser
#!/usr/bin/env bash
#
# Prerequisite: add a new bookmark directory in root directory.
#
# Usage: ./add_bookmark.sh "https://github.com/roeniss" "my github profile"
#
# Strongly recommend: Quit Chrome compeletely before execution.
#
# This is tested on m1 macbook, Ventura 13.3.1, 2023.
#
@roeniss
roeniss / keybase.md
Last active March 9, 2023 07:19
keybase.md

Keybase proof

I hereby claim:

  • I am roeniss on github.
  • I am roeniss (https://keybase.io/roeniss) on keybase.
  • I have a public key ASCZmqLvHkMiBy5EAp8aVh7NKvlpZVr725sz8asHNakh7Qo

To claim this, I am signing this object:

@roeniss
roeniss / google-otp-to-alfred-workflow.md
Last active March 5, 2023 03:48
google otp to alfred workflow
@roeniss
roeniss / visualize_tolower.py
Last active July 1, 2022 17:31
Tony Finch - tolower() in bulk at speed
# This is based on the post "2022-06-27 – tolower() in bulk at speed" by Tony Finch
# link: https://dotat.at/@/2022-06-27-tolower-swar.html
## For me, it was quite hard to understand the post without some visual helps. So I made it.
## You can run this with python3 in terminal and I hope this would help you, too.
OCTETS = "ABSOLUTE"
def show_ascii(s):
bins = bin(s)[2:].zfill(64)
@roeniss
roeniss / create_and_access_ec2.sh
Last active March 4, 2023 17:45
Instant launching ec2 using awscli
# Reference gist: https://gist.github.com/gordonmurray/4e6541f689205db3eb9bddc17a95fb1c
export AMI_ID="ami-033a6a056910d1137" # 2022.03 latest amazon linux 2 AMI
export AWS_PROFILE="roeniss"
export AWS_REGION="ap-northeast-2"
export INSTANCE_TYPE="t2.medium"
export KEY_PAIR_NAME="onetime_keypair_$(uuidgen)"
export SECURITY_GROUP_NAME="onetime_security_group_$(uuidgen)"
# Create ec2 with keypair then echo public DNS
@roeniss
roeniss / push_or_create_branch.sh
Created January 27, 2022 03:47
git push but always success even if remote branch is not created yet
git push || git push 2>&1 | sed -n 4p | bash