Skip to content

Instantly share code, notes, and snippets.

View gatherKnowledge's full-sized avatar
😅

Luke.moon gatherKnowledge

😅
  • MyPlanet Inc.
  • San Francisco, State of California.
View GitHub Profile
@gatherKnowledge
gatherKnowledge / public-stun-list.txt
Created September 12, 2021 13:20 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
const readline = require("readline");
const chalk = require("chalk");
const axios = require("axios");
const PROTOCOL = "http";
const URI = "localhost";
const PORT = 3000;
const SERVER = `${PROTOCOL}://${URI}:${PORT}`;
const PREFIX_PATH = "produce";
const TOKEN = "xxxxxxxxxxx";
type MyType = {
a1: number;
a2: number;
a3: string;
}
const foo1 = {
a1: 1
};
class House {
address?: string;
postCode?: string;
constructor() { }
}
class HouseBuilder {
private readonly _house: House;
@gatherKnowledge
gatherKnowledge / signature.ts
Last active November 12, 2020 17:28
signature
type funcType = (a: string) => (b: string) => void;
const realizeFunc: funcType = (a: string) => {
return (b: string) => {
console.log(b);
}
}
realizeFunc('')('hello world!');
@gatherKnowledge
gatherKnowledge / Model.js
Created May 20, 2020 05:08
My Axios module
import axios from "axios";
import qs from 'qs';
export default class Model {
constructor(modelName) {
this.modelName = modelName;
const instance = axios.create({
baseURL: 'http://127.0.0.1/api/',
timeout: 1000,
headers: {'X-Custom-Header': 'foobar'},

소개

이 글은 Oauth를 이용해서 access token을 획득한 후에 api에 접속하는 방법에 대해서 설명하고 있습니다.

우선 공부해야 할 것들

이 글은 WEB2 OAuth2 수업과 WEB2 HTTP 수업에 의존하고 있습니다. OAuth와 HTTP를 잘 모르신다면 이 수업들을 먼저 보시고 이 글을 볼 것을 권해드립니다.

Bearer Authentication란?

API에 접속하기 위해서는 access token을 API 서버에 제출해서 인증을 해야 합니다. 이 때 사용하는 인증 방법이 Bearer Authentication 입니다. 이 방법은 OAuth를 위해서 고안된 방법이고, RFC 6750에 표준명세서가 있습니다.

var NotifySystem = /** @class */ (function () {
function NotifySystem() {
this.observList = new Array();
}
NotifySystem.prototype.registerObserver = function (o) {
this.observList.push(o);
};
NotifySystem.prototype.removeObserver = function (o) {
this.observList = this.observList.filter(function (x) { return x !== o; });
};
{
"Profiles": [
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Red Component" : 0.40000003576278687,
"Color Space" : "sRGB",
"""
올바른 괄호란 (())나 ()와 같이 올바르게 모두 닫힌 괄호를 의미한다. )(나 ())() 와 같은 괄호는 올바르지 않은 괄호가 된다. 괄호를 이리저리 움직이며 올바른 괄호를 찾던 A씨는 N개의 괄호쌍이 있을 때, 올바른 괄호를 만들 수 있는 경우의 수가 궁금해졌다.
괄호 쌍의 개수 N개가 주어졌을 때, 경우의 수를 반환하는 코드를 작성해라. 예를 들어 N = 1일 경우는 () 의 1가지만 존재하므로 1을 리턴하면 된다.3일 경우에는((())), (())(), ()(()), ()()(), (()()) 의 5가지가 존재하므로 5를 리턴하면 된다.
N = 1 : () -> 1
N = 2 : ()(), (()) -> 2
N = 3 : ()()(), (())(), ()(()), (()()), ((())) -> 5
"""
class node: