Skip to content

Instantly share code, notes, and snippets.

View blood72's full-sized avatar

Kim Dong-Hyeon blood72

  • @marketboro 마켓보로
  • South Korea
  • 22:52 (UTC +09:00)
View GitHub Profile
@blood72
blood72 / summernote-image-resize-original.js
Created May 20, 2018 13:59
Summernote 이미지 1:1 비율 리사이즈 플러그인
/**
* Summernote Image Resize 1:1 Ratio Plugin
*
* copyright 2018 [blood72]
* email: blood72@naver.com
* license: MIT License.
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
@blood72
blood72 / wa-resource-extract.bms
Created October 14, 2018 14:22
卧龙吟(Wolong Yin, 와룡전설) .DAT Resource extraction script
# author: blood72
# script for QuickBMS http://quickbms.aluigi.org
endian big
savepos OFFSET 0
Do
goto OFFSET
# get file name
@blood72
blood72 / polycalc.c
Created May 30, 2019 06:14
학창 시절에 만든 C언어 다항식 연산기
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>// pow함수
#pragma warning (disable:4996)// 에러무시
void blankdel(char *poly);
double polycalc(char *poly, int x);
int main()
@blood72
blood72 / NumberGuessGame.c
Created May 30, 2019 06:17
학창 시절에 만든 C언어 숫자 추리 게임
#include <stdio.h>
#include <stdlib.h>
#include <time.h>//시간함수 사용.
#include <math.h>//pow(제곱)함수 사용.
#pragma warning(disable:4996)
// 답을 계산합니다. (크면 1, 작으면 -1, 정답이면 0 리턴)
int check_correct(int answer, int value, int count)
{
if (answer < value)
@blood72
blood72 / Banker'sAlgorithm.c
Created May 30, 2019 06:19
학창 시절에 만든 C언어 은행가 알고리즘 (반성하자 더티코드ㅜ_ㅜ)
#include <stdio.h>
#pragma warning(disable:4996)
int main() {
int allocated_table[5][5]; //할당 행렬A
int claim_table[5][5]; //요구 행렬C
int avaliable_vector[5]; //가용 벡터V
int allocated_vector[5] = { 0, 0, 0, 0, 0 }; //할당 벡터C-A
int resource_vector[5]; //자원 벡터R
int isRun[5]; //현재 프로세스 실행상태
@blood72
blood72 / LinkedListADT.c
Created May 30, 2019 06:30
학창 시절에 만든 C언어 구조체 연결리스트 (int형 / char형 주석구분)
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable:4996) //scanf 에러문 무시
// #define BUF_SIZE 100 // char 형태 데이터
// #define NAME_SIZE 20 // char 형태 데이터
typedef struct Node{
int data; // int 형태 데이터
@blood72
blood72 / SortData.c
Created May 30, 2019 06:31
학창 시절에 만든 C언어 정렬비교
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <malloc.h>
#pragma warning(disable:4996)
// 선택 정렬
void SelectionSort(int list[], int n)
{
int i, j, least, temp;
@blood72
blood72 / stack.c
Created May 30, 2019 06:39
학창 시절에 만든 C언어 스택 (feat. 후위표기식 변환)
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable:4996)
// 노드 정의 선언
typedef struct
{
int item;
@blood72
blood72 / treeorder.c
Created May 30, 2019 06:45
학창 시절에 만든 C언어 이진 트리 순회
#include <stdio.h>
#include <stdlib.h>
typedef struct TreeNode
{
int data;
struct TreeNode *llink, *rlink;
} TreeNode;
/*
@blood72
blood72 / Directory.php
Last active June 25, 2019 06:31
Route::file, Route::directory macro with route_path() helper in Laravel
<?php
use Illuminate\Support\Facades\Route;
if (! Route::hasMacro('directory')) {
Route::macro('directory', function ($path, $attributes = [], $recursive = false) {
$route = $this; // for IDE
/** @var Route $route */
return $route->group((array) $attributes, function () use ($path, $recursive) {
foreach (File::{$recursive ? 'allFiles' : 'files'}($path) as $file) {