Skip to content

Instantly share code, notes, and snippets.

View if1live's full-sized avatar
💭
I may be slow to respond.

byunghoo.yu if1live

💭
I may be slow to respond.
View GitHub Profile
@if1live
if1live / pufferpanel_api.json
Created August 22, 2023 01:41
PufferPanel API
View pufferpanel_api.json
{
"schemes": [],
"swagger": "2.0",
"info": {
"description": "PufferPanel API interface for both the panel and daemon. Endpoints starting with /daemon or /proxy are for nodes.",
"title": "PufferPanel API",
"contact": {
"name": "PufferPanel",
"url": "https://pufferpanel.com"
@if1live
if1live / main.ts
Last active January 17, 2022 16:14
https://www.acmicpc.net/ typescript + windows + powershell template
View main.ts
import fs = require('fs')
function read_stdin(): string {
return fs.readFileSync(0).toString();
}
const chunk = read_stdin();
const numbers = chunk.split('\n')[0].split(' ').map(x => parseInt(x, 10));
const [a, b] = numbers;
const c = a + b;
process.stdout.write(c.toString());
@if1live
if1live / index.ts
Created July 18, 2020 17:38
API spec based api server/client library
View index.ts
import yup = require('yup');
import express from 'express';
import fetch, { Response } from 'node-fetch';
type Method = 'get' | 'post' | 'delete' | 'put';
interface Api<Req, Resp> {
name: string;
method: Method;
// url = resource + page
@if1live
if1live / index.ts
Last active July 15, 2020 14:36
generic based rosie constructor
View index.ts
import { Factory } from 'rosie';
import { NonFunctionKeys } from 'utility-types';
// maybe typeorm entity
class Entity {
constructor() {
this.a = 0;
this.b = null;
}
public a: number;
@if1live
if1live / cls-hooked-express-logging.js
Created July 11, 2020 04:28
cls-hooked + express + console.info()
View cls-hooked-express-logging.js
/**
* test
* curl "http://127.0.0.1:3000/?id=1" & curl "http://127.0.0.1:3000/?id=2"
*/
const express = require('express');
const delay = require('delay');
const { getNamespace, createNamespace } = require('cls-hooked');
const NSID = 'writer';
@if1live
if1live / httpclient_unity_sample.cs
Created January 15, 2019 02:27
C# HttpClient + Unity + GET + json body
View httpclient_unity_sample.cs
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Text;
using UnityEngine;
using UnityEngine.Networking;
using System.Net.Http;
using System.Net;
@if1live
if1live / httpclient_sample.cs
Created January 15, 2019 02:04
c# HttpClient + GET + json body
View httpclient_sample.cs
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;
namespace httpclient
View hangul_number.js
/*
오늘의 코딩 퀴즈
숫자를 기수로 변환하기
1 => 일
73 => 칠십삼
598 => 오백구십팔
1920 => 일천구백이십
View timezone.sql
SHOW VARIABLES LIKE '%time_zone%'
@if1live
if1live / sample.ts
Created November 8, 2018 03:34
indexedDBShim + dexie + typescript test
View sample.ts
const setGlobalVars = require('indexeddbshim');
(global as any).window = global; // We'll allow ourselves to use `window.indexedDB` or `indexedDB` as a global
setGlobalVars(); // See signature below
(window.indexedDB as any).__setConfig({
checkOrigin: false,
});
const Dexie = require('dexie');
var db = new Dexie('friend_database');
db.version(1).stores({