Skip to content

Instantly share code, notes, and snippets.

View ryush00's full-sized avatar

SeongHoon Ryu ryush00

  • South Korea
  • 02:04 (UTC +09:00)
View GitHub Profile
@hakanilter
hakanilter / ecs-run-and-wait.sh
Last active December 7, 2023 16:50
AWS ECS run task and wait for the result
# Requies JSON as the output format and "jq" commandline tool
# If task runs successfuly, exits 0
run_result=$(aws ecs run-task \
--cluster ${CLUSTER} \
--task-definition ${TASK_DEFINITION} \
--launch-type EC2 \
--overrides "${OVERRIDES}")
echo ${run_result}
container_arn=$(echo $run_result | jq -r '.tasks[0].taskArn')
aws ecs wait tasks-stopped \
@xnuk
xnuk / hyeong.md
Last active February 11, 2024 15:10
난해한 혀엉.... 언어

이 문서가 여기저기 알려짐에 따라, 이곳에 여러가지 댓글이 달리고 있습니다. 개인적으로는 댓글창을 없애버리고 싶지만 그럴 수 없는 터라, 댓글을 달기 전에 한번씩만 더 생각해주셨으면 합니다.

  • 개인적인 감상은 이곳이 아닌 다른 곳에 적어주세요.
  • 동성애 혐오적인 댓글을 달지 마세요.
  • 기타 "난해한 혀엉... 언어"와 관련없는 댓글을 달지 말아주세요.

위 사항들을 포함해 제 마음에 안 드는 댓글들은 임의로 삭제하고 있습니다. 양해 부탁드립니다.


@kimsuelim
kimsuelim / audit_log.md
Last active September 18, 2018 01:21
Rails 앱에 audit log 활성화하기

Rails 앱에 audit log 활성화하기

서비스를 운영할 때 admin tool은 필수입니다. 운영진은 사용자의 개인정보에 접근하거나 사용자의 요청에 따른 수정, 환불과 같은 이슈를 해결해야 합니다. 개발자에게 요청하여 수동으로 처리하는 경우가 많은가요? 개발자의 시간과 집중력은 소중하기에 수동으로 처리해야 하는 일은 최소로 줄여야 합니다.

그렇다면 운영진이 중요한 정보에 접근하거나 수정하는 것을 어떻게 기록할까요? 이럴 경우 저는 쉽고 빠르게 적용 가능한 audit log를 사용합니다. audit log에 기록하는 내용:

  • 접근한 페이지의 controller와 params
@4poc
4poc / gist:6281388
Last active July 1, 2021 13:53
Minecraft supports querying the MOTD, player count, max players and server version via the usual port, this ruby class implements this. Works with ruby >= 1.9.3/2.0.0
require 'socket'
##
# Pings a minecraft server and returns motd and playercount.
# Works with ruby >=1.9.3/2.0.0
#
# More information and sample code here:
# http://wiki.vg/Server_List_Ping
##
class MinecraftPing
@wedtm
wedtm / mcquery.rb
Created February 29, 2012 11:04
MCQuery - Minecraft Query Implementation in Ruby
require 'socket'
require 'timeout'
class MCQuery
MAGIC_PREFIX = "\xFE\xFD"
PACKET_TYPE_CHALLENGE = "\x09"
PACKET_TYPE_QUERY = "\x00"
ID = "\x00\x00\x00\x00"
DEFAULTS = {
host: "localhost",
@wedtm
wedtm / gist:1906478
Created February 25, 2012 04:35
Ruby based Minecraft Vanilla Query Check
#
# Tested on 1.9.2-p290, Written by Miles Smith (WedTM)
#
require 'socket'
class MCQuery
MAGIC_PREFIX = "\xFE\xFD"
PACKET_TYPE_CHALLENGE = "\x09"
PACKET_TYPE_QUERY = "\x00"
@jcasimir
jcasimir / friendly_urls.markdown
Created September 11, 2011 15:48
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.