Skip to content

Instantly share code, notes, and snippets.

View malkoG's full-sized avatar
😎
FULL SWAG DEVELOPER WANNABE

Lee Jae-yeol malkoG

😎
FULL SWAG DEVELOPER WANNABE
View GitHub Profile
@malkoG
malkoG / ruby-warrior level6
Created December 3, 2013 15:44
Just for back up
class Player
def play_turn(warrior)
# cool code goes here
if warrior.feel.enemy?
warrior.attack!
elsif warrior.feel.captive?
warrior.rescue!
else
if @health.nil?
@malkoG
malkoG / md-to-pdf.sh
Last active May 7, 2016 04:03
md-to-html 스크립트로 변환된 HTML파일을 제본하기 쉽게 PDF파일로 변환하는 스크립트( wkhtmltopdf 설치해둘 필요가 있음. $PATH_HTMLTOPDF 는 wkhtmltopdf 바이너리파일의 위치를 의미)
#/usr/bin/sh
# Usage : md-to-pdf filename
#
# Do not use extension name
# md-to-pdf README ( O )
# md-to-pdf README.md ( X )
# md-to-pdf README.html ( X )
echo "Transforming .md files into .pdf files"
@malkoG
malkoG / md-to-html.rb
Created May 7, 2016 03:48
마크다운으로 작성된 문서를 HTML 문서로 변환(gem install kramdown으로 젬을 설치해야함)
#!/usr/bin/ruby
require 'kramdown'
puts " .md ===========> .html "
header = <<HERE
<html>
<head>
<meta charset='utf8'>
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DialogueManager : MonoBehaviour {
public GameObject dialogueBox;
public Text dialogueText;
private static int dialogueIndex;
@malkoG
malkoG / interview timetable.rb
Last active March 7, 2017 00:26
구글 폼즈로 받은 양식을 스프레드시트로 보내고, 스프레드시트의 결과를 tsv파일로 받아 어느 날짜에 누가 희망하는지 빠르게 정리하기 위한 목적.
# coding: utf-8
a=[]
b=Hash.new(0)
c=Hash.new(0)
d=Hash.new(0)
keys = []
vals = []
list = []
num = 0
@malkoG
malkoG / scoring.py
Last active November 23, 2017 00:59
OS Page Table Simulation HW scoring script
import os
import sys
import subprocess
import copy
traces = [ '../mtraces/'+ a for a in os.listdir('../mtraces') ]
len_traces = len(traces)
pass_count = 0
fail_count = 0
@malkoG
malkoG / makeheader.py
Last active September 28, 2018 15:59
미디어위키 문법에 맞게 챕터별로 헤더 만들기
with open('scratch.txt', 'r') as f:
lines = f.read().strip().split('\n\n')
for line in lines:
print('=' + line + '=')
f.close()
@malkoG
malkoG / run_many_clients.sh
Last active November 23, 2018 08:47
혼긱머 네트워크 프로그래밍 과제로 고통받는 사람들을 위한 선물
# Usage bash run_many_clients.sh <SERVER_IP> <# of clients> <input textfile>
# EX) bash run_many_clients.sh 192.168.0.2 16 fakelog.txt
echo "" > output.txt
for (( i=1; i<$2; i++ ))
do
echo "[$(($i/10))$(($i%10))]" $(/usr/bin/time ./tcpcli02 $1 < $3 2>&1 >/dev/null) >> output.txt &
done
echo "[$(($2/10))$(($2%10))]" $(/usr/bin/time ./tcpcli02 $1 < $3 2>&1 >/dev/null) >> output.txt
@malkoG
malkoG / 10821.rb
Created March 17, 2019 06:02
10821.rb
p gets.split(',').count
s=gets.chomp
(s.size/10.0).ceil.times {|x| puts s[(10*x)..(10*x+9)]}