Skip to content

Instantly share code, notes, and snippets.

View kenu's full-sized avatar
💭
For Values

kenu kenu

💭
For Values
View GitHub Profile
<project>
...
<properties>
<findbugs.version>2.5.2</findbugs.version>
<checkstyle.version>2.9.1</checkstyle.version>
<surefire.reportplugin.version>2.12.4</surefire.reportplugin.version>
<cobertura.version>2.5.2</cobertura.version>
</properties>
@kenu
kenu / App.jsx
Last active February 28, 2022 08:11
import { useState, useEffect } from 'react'
import logo from './logo.svg'
import './App.css'
function App() {
const [count, setCount] = useState(0)
function getHello() {
const greet = document.getElementById('greet')
fetch('http://localhost:4000/api/hello')
.then(response => response.json())
@kenu
kenu / deploy-main.yml
Created February 28, 2022 08:04
.github/workflows
name: remote ssh command for deploy
on:
push:
branches: [main]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using key
echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew" | sudo tee -a /etc/crontab > /dev/null
cat /etc/crontab
@kenu
kenu / nginx.conf
Created February 28, 2022 07:58
reverse proxy
location / {
sendfile off;
proxy_pass http://127.0.0.1:4000;
proxy_redirect default;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
@kenu
kenu / api.js
Created February 28, 2022 06:51
jsdoc
const express = require('express');
const router = express.Router();
/**
* @openapi
* /api/hello:
* get:
* description: Welcome to swagger-jsdoc!
* parameters:
* - name: name
* in: query
@kenu
kenu / hide.js
Last active September 8, 2021 07:49
Hide lines of issue with `Bump` keyword.
* Hide line of issues with `Bump` keyword.
* Use this code in console of GitHub issue list page.
```js
const issues = document.querySelectorAll('.js-issue-row');
[...issues].forEach((issue, idx) => {
issues[idx].hidden = issue.innerText.includes('Bump');
});
```
@kenu
kenu / gist:971d4354f09bd2490c7a69c69f1cb988
Created December 19, 2020 14:02
extract youtube list
var items = document.querySelectorAll('[id=dismissable]')
items.forEach(item => {
var data = {
title: item.children[1].children[0].children[0].innerText,
link: item.children[1].children[0].children[0].children[1].href,
meta: item.children[1].children[0].children[1].innerText
};
console.log(JSON.stringify(data));
});
@kenu
kenu / jest.md
Last active May 25, 2020 09:11
jest

Jest

jest 설치

npm i -g jest

파일 테스트

  • 개별 파일
@kenu
kenu / decodeAny
Created March 3, 2020 02:56
decodeAny
package com.okdevtv;
import static org.junit.Assert.*;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import org.junit.Test;
public class KrDecoderTest {
@Test