Skip to content

Instantly share code, notes, and snippets.

🏃‍♀
keep going

ohoroyoi

🏃‍♀
keep going
Block or report user

Report or block ohoroyoi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ohoroyoi
ohoroyoi / leaflet_marker.html
Created Aug 28, 2019
leaflet 클릭하면 마커에 포커싱하게 하는것 (과정)
View leaflet_marker.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Leaflet tutorial</title>
</head>
<body>
<script
src="https://code.jquery.com/jquery-2.2.4.js"
@ohoroyoi
ohoroyoi / leaflet_tutorial.html
Created Aug 27, 2019
leaflet save to db and retrieve from db
View leaflet_tutorial.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Leaflet tutorial</title>
</head>
<body>
<script
src="https://code.jquery.com/jquery-2.2.4.js"
View get_airline_from_wiki.py
import requests
from lxml import etree
import wikipedia
import csv
import wikipediaapi
wiki_en = wikipediaapi.Wikipedia('en')
wiki_en = wikipediaapi.Wikipedia(
language='en',
extract_format=wikipediaapi.ExtractFormat.WIKI
View this_is_promise_arr.js
const getTodos = (id) => {
return new Promise((resolve, reject) => {
$.getJSON(`https://jsonplaceholder.typicode.com/todos/${id}`, (data) => {
resolve(data);
console.log(data);
});
});
}
Promise.all([
@ohoroyoi
ohoroyoi / whatOrderDoesItHave.js
Created Jul 13, 2019
이렇게 하면 순서가 어떻게 출력이 될까요?
View whatOrderDoesItHave.js
const getTodos = (id) => {
return new Promise((resolve, reject) => {
$.getJSON(`https://jsonplaceholder.typicode.com/todos/${id}`, (data) => {
resolve(data);
console.log(data);
});
});
}
// // 아래처럼 하면 순서보장 x
@ohoroyoi
ohoroyoi / asyncAwaitNewbie.js
Created Jul 13, 2019
async await 정말 편하조
View asyncAwaitNewbie.js
const getTodos = (id) => {
return new Promise((resolve, reject) => {
$.getJSON(`https://jsonplaceholder.typicode.com/todos/${id}`, (data) => {
resolve(data);
});
});
}
@ohoroyoi
ohoroyoi / promise_first.js
Last active Jul 13, 2019
출력결과가 어떻게 될까요
View promise_first.js
// const todosPromise = new Promise((resolve, reject) => {
// const condition = Math.random() > 0.5; //true or false
// return condition ? resolve('성공했어요') : reject('실패했어용');
// });
// // console.log(todosPromise);
// todosPromise.then((data) => {
// console.log(data);
@ohoroyoi
ohoroyoi / callback_usage_more.js
Created Jul 13, 2019
할튼 콜백 내가 너 이해해버린다 이거임
View callback_usage_more.js
$.getJSON('https://jsonplaceholder.typicode.com/todos/1', (data) => {
console.log(data);
});
const getTodos = (id, onSuccess) => {
$.getJSON(`https://jsonplaceholder.typicode.com/todos/${id}`, (data) => {
// console.log(data);
onSuccess(data);
});
@ohoroyoi
ohoroyoi / callback_usage.js
Created Jul 13, 2019
이 짧은 코드가 이해가 안가서 몇번을 읽었는지
View callback_usage.js
const getTime = (callback) => {
callback('안녕');
}
getTime((message)=>{
console.log(message);
});
@ohoroyoi
ohoroyoi / what_is_call_back.js
Last active Jul 13, 2019
what_is_call_back.js
View what_is_call_back.js
// callback : 인자로 함수를 받는 형태
function add(a, b){
return a + b;
}
function addFour(x, f){ // 인자로 함수를 받는 형태
return f(x, 4);
}
You can’t perform that action at this time.