Skip to content

Instantly share code, notes, and snippets.

View ezaurum's full-sized avatar
🏠
Working from home

Cho seokgyu ezaurum

🏠
Working from home
View GitHub Profile
@ezaurum
ezaurum / emptify-s3-bucket.py
Created April 11, 2023 11:47
Emptify S3 bucket
#!/usr/bin/env python
import boto3
import sys
PROFILE = sys.argv[1]
BUCKET = sys.argv[2]
session = boto3.Session(profile_name = PROFILE)
s3 = session.resource('s3')
bucket = s3.Bucket(BUCKET)
const fs = require("fs")
const line = fs.readFileSync("/dev/stdin").toString().split("\n")
const limit = Number(line[0])
console.log(line.slice(1, limit + 1).reduce( (result, l, idx, arr) => {
const [a, b] = l.split(/\s/).map(Number)
return result + (a + b) + "\n"
}, ""))
function solution(input) {
const first = input[0].split(/\s/)
const n = parseInt(first[0])
const m = parseInt(first[1])
const cardArray = input[1].split(/\s/).map(l=>parseInt(l))
let max = 0, sum = 0
for (let i = 0; i < n - 2 ; i++) {
for (let ii = i + 1; ii < n - 1; ii++) {
for ( let iii = ii + 1; iii < n ; iii++) {
@ezaurum
ezaurum / sort-files.sh
Created February 3, 2022 16:42
파일을 수정 시각순으로 정렬
find . -type f -printf "%T@ %f\n" | sort -n > out.txt
<template>
<div class="tweet">
<article class="media">
<figure class="media-left">
<p class="image is-64x64">
<img class="user-image" :src="tweet.userImage">
</p>
</figure>
<div class="media-content">
<div class="content">
@ezaurum
ezaurum / convert-m4a-to-mp3.sh
Created January 26, 2021 09:11
M4A 파일 MP3로 일괄 변환
for m in *.m4a
do ffmpeg -v 5 -y -i $m -acodec libmp3lame -ac 2 -ab 192k "${m%.m4a}.mp3"
done
@ezaurum
ezaurum / gist:50c5e02c35558d8220cc5f65cee38ab5
Created January 22, 2021 13:48
vue hash 로 스크롤
mounted() {
Vue.nextTick(() => {
const hash = this.$route.hash
if (hash) {
const element = document.querySelector(hash)
document.scrollingElement.scroll({
top: element.offsetTop,
})
}
})
@ezaurum
ezaurum / main.go
Last active June 27, 2020 11:07
range 로 만든 변수를 사용시 고려할 점
package main
import (
"fmt"
"sync"
)
var (
test = []string{
"11B804806F367001",
@ezaurum
ezaurum / main.go
Created June 25, 2020 05:56
시간 예제
package main
import (
"fmt"
"time"
)
func main() {
t := time.Now()
if t.Hour() > 12 {
@ezaurum
ezaurum / api.tf
Last active February 28, 2020 16:29
api.tf
resource "aws_ecs_cluster" "api" {
name = "${var.organization}-api-${var.stage}"
tags = {
Name: "${var.organization} API cluster ${var.stage}"
Organization:var.organization
Stage : var.stage
}
}
resource "aws_ecs_task_definition" "api" {