Skip to content

Instantly share code, notes, and snippets.

@ayaysir
ayaysir / Paginator.java
Last active Aug 26, 2020
페이지네이션(Pagination) 도와주는 프로그램
View Paginator.java
package com.example.awsboard.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 페이지네이션을 위한 숫자 리스트 생성기
*
@ayaysir
ayaysir / MidiApiController.java
Last active Aug 17, 2020
Safari <audio> 태그의 구간 탐색 문제 ("라이브 방송") 해결 코드
View MidiApiController.java
package com.example.awsboard.web;
import com.example.awsboard.config.auth.LoginUser;
import com.example.awsboard.config.auth.dto.SessionUser;
import com.example.awsboard.service.posts.MidiService;
import com.example.awsboard.util.TimidityRunner;
import com.example.awsboard.web.dto.midi.MidiPublicResponseDTO;
import com.example.awsboard.web.dto.midi.MidiRequestDTO;
import com.example.awsboard.web.dto.midi.MidiResponseDTO;
import lombok.RequiredArgsConstructor;
View intersection-observer-infinite-scroll.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IntersecionObserver: infinite scroll example</title>
<style>
body {
padding: 30px;
background-color: gray;
}
View TimidityRunner.java
import java.io.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class TimidityRunner {
// 여기로 보낼 때 루트 패스 포함해서 보냄.
public static File convertMidiToMp3(String midiPath) throws IOException {
Integer lastIndexOfDot = midiPath.lastIndexOf(".");
View tts.html
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<select id="select-lang">
View mic-test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>마이크 테스트</title>
</head>
<body>
<input type=checkbox id="chk-hear-mic"><label for="chk-hear-mic">마이크 소리 듣기</label>
View multi-lang-1.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1 id="title" data-lang="title">[title]</h1>
<p id="content" data-lang="content">[content]</p>
View doubly-linked-list.py
## 노드 클래스
class Node:
def __init__(self, data, prev=None, next=None):
self.data = data
self.prev = prev
self.next = next
## 노드 관리자 클래스
class NodeMgmt:
View darkmode.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html.darkmode {
View FourDirection.java
public class FourDirection {
public static int[][] getDirection(int select) {
if(select == 3) {
// 방향 설정: 반시계 방향 (ENSW)
return new int[][]{
{0, -1, 0, 1},
{1, 0, -1, 0}
};
} else if(select == 2) {
You can’t perform that action at this time.