View pufferpanel_api.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" |
View main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); |
View index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Factory } from 'rosie'; | |
import { NonFunctionKeys } from 'utility-types'; | |
// maybe typeorm entity | |
class Entity { | |
constructor() { | |
this.a = 0; | |
this.b = null; | |
} | |
public a: number; |
View cls-hooked-express-logging.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'; |
View httpclient_unity_sample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
View httpclient_sample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
오늘의 코딩 퀴즈 | |
숫자를 기수로 변환하기 | |
1 => 일 | |
73 => 칠십삼 | |
598 => 오백구십팔 | |
1920 => 일천구백이십 |
View timezone.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHOW VARIABLES LIKE '%time_zone%' |
View sample.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({ |
NewerOlder