react Box component 만들기 1234567891011import React from "react"; class Box extends React.Component { render() { return ( hello ) }} export default Boxcs hello가 출력되는 Box 만들기. import Box from './components/Box'이렇게 import하고 쓴다. click event만들기1234567891011121314151617181920import React from "react"; class Box extends React.Component { constructor(props) { super(props) this.handleOnClick = this.handle..
request post 호출 requestPost.js1234567891011121314151617181920const request = require('request'); exports.getString = callback => (url, forms) => request({ url, method: 'POST', form: forms, timeout: 10000, followRedirect: true, maxRedirects: 10,},(error, response, body) => { if (!error && response.statusCode === 200) { console.log(url); callback(body); } else { console.log(`error${response.status..
javascript 두가지 조건으로 정렬하기 조건에 if에 else if를 추가해서 n개의 조건을 줄 수 있습니다. const studentList = [ { name: 'kyeongrok', age: 31, math: 85, english: 87 }, { name: 'jihyun', age: 31, math: 95, english: 97 }, { name: 'minsup', age: 35, math: 76, english: 84 }, { name: 'dasom', age: 35, math: 84, english: 73 }, { name: 'yuna', age: 26, math: 54, english: 67 }, { name: 'mattheue', age: 29, math: 34, english: 100..
electron에서 ipcRenderer 사용하기 - 제2편 ipcRenderer import하기 루트(/)에 있는 /index.js를 잘라내기 해서 현재 비어있는 /src/main/으로 덮어쓰기 한다. 안에 내용을 복사해다가 붙혀도 된다. 루트에 있는 index.js를 없애면 된다. /src/main/index.js const electron = require('electron'); // Module to control application life. const app = electron.app; // Module to create native browser window. const BrowserWindow = electron.BrowserWindow; const path = require('path'..
electron에서 ipcRenderer 사용하기 pc용 앱이 필요할 때가 있습니다. 언제 필요하냐면 내가 만든 앱인데 .js로 주면 개발자가 아닌 사람들은 실행을 못시킵니다. node.js깔고 git clone받고 이거 안한다고 해도 npm install 해야하고 등 이론적으론 가능하지만 실질적으론 불가능에 가깝습니다. 그래서 이런식으로 어떤 버튼이 있고 누르면 뭔가 결과가 표 형태로 나와서 엑셀에 붙혀넣기 할 수 있게 만들어 주어야 합니다. 그럴때 일렉트론을 쓰면 무언가 실행해서 버튼을 누를 수 있게 이렇게 앱을 만들어 줄 수가 있습니다. 한번 잘 만들어 놓으면 뒤에 엔진만 바꾸면 되기 때문에 한번쯤은 하나 빌드를 해놓고 필요할 때 마다 다른 엔진을 붙혀서 빌드를 하면 여러가지 간단 하지만 유용한 프..
공공데이터 이용하는 방법 선 소스코드https://github.com/Kyeongrok/korea_public_data https://www.data.go.kr/ 한국에는 '공공데이터포털'이라는데가 있다.공공의 퍼블릭한 데이터를 조회를 할 수 있는 사이트다.근데 크롬으로는 뭔가 막힌다. 그래서 ie를 띄워야돼는데 윈도 10에서는 ie엣지가 기본인데 ie엣지도 안된다. 그래서 프로그램파일에서 internetexplorer.exe이걸 찾아서 실행해야 한다. 회원가입을 해주고 로그인을 한다. 그 사이에 보안 관련 .exe가 설치된다.ie로 전환을 했다. 회원가입 & 로그인을 해주고 '데이터셋 - 오픈API'로 들어간다.세번째 오픈 API 탭을 누르면 알흠답게 2,373가지 정보를 내 맘대로 막 조회해보고 데이..
print to file using node.js Colored By Color Scripter™ 1 2 3 4 const fs = require('fs'); fs.writeFile('message.txt', 'hello'); message.txt라는 파일에 ‘hello’라고 쓰고 저장을 하고 싶다면 fs.writeFile()을 이용하면 됩니다. fs.writeFile()을 이용하면 console.log()에만 나오던 프로그램 실행 결과를 파일로 간단하게 출력 할 수 있습니다.
Promise로 단계별로 실행하기 Colored By Color Scripter™1234567891011// Promise로 단계별로 실행하기// 이렇게 하면 promise를 한개만 만들어서 .then으로 순차적으로 처리할 수 있다.new Promise((resolve) => { resolve(1); // 핵심은 첫번째는 resolve() 를 쓴다는 것.}).then((result) => { console.log('first:', result) return result + 'hello';}).then((result) => { console.log('second:', result) return result + 'nello';}); resultfirst:1second:1hello 마지막에 nello는 con..
electron에서 express쓰기 참고 : https://blog.samuelattard.com/using-express-inside-electron/결론부터 말하자면 electron에서 express를 쓰는건 안된다. 어찌어찌 띄울수는 있는데 사용자 pc마다 방화벽 설정도 대부분 되어있고로컬에서 포트를 오픈한다는 것 자체가 꽤나 위험을 동반하는 일이기 때문이기도 하다.내꺼에서는 되었다고 해도 배포한 pc에서는 안될 수 있다는 것.그런데 왜 안돼는 express를 자꾸 쓰고 싶을까?왜냐하면 restful api를 구축을 하고 싶기 때문이다. 이 방법이 익숙하고 앱을 만드는데 굉장히 좋은 방법이기도 하다. 나도 그래서 electron에 express를 어떻게 띄워볼려고 계속 찾아보다가 결국은 이게 안된..
- Total
- Today
- Yesterday
- 도커각티슈케이스
- docker container tissue
- Sh
- docker container
- docker container case
- docker container tissue box
- 이직
- Linux
- 도커티슈박스
- 개발자
- 도커컨테이너
- docker container whale
- vim
- 도커각티슈박스
- shellscript
- 도커티슈케이스
- 싱가폴
- 2017 티스토리 결산
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |