Skip to content

Instantly share code, notes, and snippets.

View shsunmoonlee's full-sized avatar

Seunghun Sunmoon Lee shsunmoonlee

View GitHub Profile
@shsunmoonlee
shsunmoonlee / example-landmark.json
Created August 17, 2020 19:40
example-landmark.json
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,
@shsunmoonlee
shsunmoonlee / gist:c10cc89b07fa752fac0222fc9ca4eb9e
Created July 4, 2020 06:44
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)
}
@shsunmoonlee
shsunmoonlee / LRU Cache.js
Created February 4, 2020 13:39
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) {
@shsunmoonlee
shsunmoonlee / LRU Cache.js
Created February 4, 2020 13:39
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"
}
@shsunmoonlee
shsunmoonlee / async-http.js
Last active June 26, 2021 17:31
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`;
@shsunmoonlee
shsunmoonlee / 102. Binary Tree Level Order Traversal.js
Created April 18, 2019 18:36
102. Binary Tree Level Order Traversal
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[][]}
@shsunmoonlee
shsunmoonlee / permutations.js
Created April 17, 2019 19:57
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
@shsunmoonlee
shsunmoonlee / flattenArray.js
Created January 13, 2019 06:50
flattenArray
View flattenArray.js
const flatten = list => list.reduce(
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
);