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
#include <stdio.h> | |
int main(){ | |
printf("hello world!\n"); | |
return 0; | |
} |
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 request = require('request'); | |
new Promise((resolve, reject)=>{ | |
console.log(1); | |
resolve(new Promise((resolve, reject)=>{ | |
request({url:'http://www.naver.com'},()=>{ | |
console.log(2); | |
resolve(3); | |
}); | |
})); | |
}).then(data=>{ |
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
// It is bad case about using Promise.All | |
let value = [1,2,3,4,5]; | |
var promises = []; | |
for(let i=0;i<5;i++){ | |
promises.push( | |
((data)=>{ | |
return new Promise((resolve, reject)=>{ | |
setTimeout(() => { |
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
sudo apt-get install -y mysql-client mysql-server mysql-common |
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
sudo apt-get install -y curl | |
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
OUTPUT="$(npm config get prefix)" | |
echo "$OUTPUT" | |
if [ "$OUTPUT" == "/usr/local" ]; then | |
OUTPUT="$(sudo chown -R $USER /usr/local)" |
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
sudo npm install -g yarn | |
sudo yarn global add create-react-app | |
sudo yarn global add express-generator | |
sudo yarn global add nodemon | |
sudo yarn global add concurrently | |
# 에러 발생시 global node_modules 초기화 | |
# for create-react-app with redux and router | |
# yarn add redux react-redux | |
# yarn add react-router-dom |
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
function printElement(ele, w = 800, h = 400){ | |
var divContents = document.querySelector(ele).innerHTML; | |
var printWindow = window.open('', '', `height=${h},width=${w}`); | |
printWindow.document.write('<html><head><title>NoName</title>'); | |
printWindow.document.write('</head><body >'); | |
printWindow.document.write(divContents); | |
printWindow.document.write('</body></html>'); | |
printWindow.document.close(); | |
printWindow.print(); | |
} |
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
#include <cstdio> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#include <iostream> |
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
#include <cstdio> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <iostream> | |
#include <thread> |
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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(A, K) { | |
let arr = []; | |
// write your code in JavaScript (Node.js 8.9.4) | |
if(A.length === K || K === 0 || A.length === 0){ | |
return A; | |
} | |
for(let i = 0 ; i < K ; i ++ ){ |
OlderNewer