Skip to content

Instantly share code, notes, and snippets.

Avatar

Seunghun Sunmoon Lee SeunghunSunmoonLee

View GitHub Profile
View example-landmark.json
{
"IMG_20200709_181039_2.jpg": {
"width": 3024,
"height": 4032,
"fullFaceDescriptions": [
{
"detection": {
"_imageDims": { "_width": 3024, "_height": 4032 },
"_score": 0.756403923034668,
"_classScore": 0.756403923034668,
@SeunghunSunmoonLee
SeunghunSunmoonLee / gist:c10cc89b07fa752fac0222fc9ca4eb9e
Created Jul 4, 2020
blocket automated find tenant like script
View gist:c10cc89b07fa752fac0222fc9ca4eb9e
let clickButton = () => {
let button = document.querySelector('#app > div > div.FocusContainer > div > div > div.MatchingUserEvaluationHandler > div.Submit > div > div.button.apply')
button.click()
}
let intervalID
let startAutomaticInterval = (seconds) => {
if(intervalID) { clearTimeout(intervalID) }
intervalID = setInterval(clickButton, seconds*1000)
}
@SeunghunSunmoonLee
SeunghunSunmoonLee / LRU Cache.js
Created Feb 4, 2020
Classic LRU Cache in JavaScript. Goal: Real World Implementation
View LRU Cache.js
function ListNode(key, value) {
this.value = value
this.key = key
this.next = this.prev = null
}
/**
* @param {number} capacity
*/
var LRUCache = function(capacity) {
@SeunghunSunmoonLee
SeunghunSunmoonLee / LRU Cache.js
Created Feb 4, 2020
Classic LRU Cache in JavaScript. Goal: Real World Implementation
View LRU Cache.js
function ListNode(key, value) {
this.value = value
this.key = key
this.next = this.prev = null
}
/**
* @param {number} capacity
*/
var LRUCache = function(capacity) {
View nodemon.json
{
"events": {
"restart": "kill-port 3010",
"crash": "kill-port 3010"
},
"delay": "1500"
}
@SeunghunSunmoonLee
SeunghunSunmoonLee / async-http.js
Last active May 30, 2019
How to asynchronously use nested http.get request using native node.js method.
View async-http.js
/*
* Complete the function below.
* Instead of returning the answer, log the answer to the console.
* https://jsonmock.hackerrank.com/api/countries/search?name=
*/
function getCountries(s, p) {
let answer = 0;
const https = require("https");
let base_url = `https://jsonmock.hackerrank.com/api/countries/search`;
View 102. Binary Tree Level Order Traversal.js
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @return {number[][]}
@SeunghunSunmoonLee
SeunghunSunmoonLee / permutations.js
Created Apr 17, 2019
leetcode - permutations.js
View permutations.js
/**
* @param {number[]} nums
* @return {number[][]}
*/
function swap(nums, i, j) {
let temp = nums[i]
nums[i] = nums[j]
nums[j] = temp
}
const indent = (length) => {
View gist:edf8fa1d5fc9ee21d4818e80c125ebaa
code --install-extension christian-kohler.npm-intellisense
code --install-extension christian-kohler.path-intellisense
code --install-extension CoenraadS.bracket-pair-colorizer-2
code --install-extension dbaeumer.vscode-eslint
code --install-extension dracula-theme.theme-dracula
code --install-extension dsznajder.es7-react-js-snippets
code --install-extension eamodio.gitlens
code --install-extension esbenp.prettier-vscode
code --install-extension felipecaputo.git-project-manager
code --install-extension formulahendry.auto-close-tag
View flattenArray.js
const flatten = list => list.reduce(
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
);