This file contains hidden or 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
| # python-hwpx 스타일링 가이드 | |
| > python-hwpx v2.8.3 기준. HWPX 문서의 글꼴·크기·색상·정렬·간격 등 스타일 적용 방법. | |
| ## 1. 스타일 구조 개요 | |
| HWPX 문서의 스타일은 `Contents/header.xml`에 정의되고, `Contents/section*.xml`의 문단/런에서 ID로 참조한다. | |
| ``` | |
| header.xml |
This file contains hidden or 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
| if (!process.env.NODE_PATH) { | |
| console.log(); | |
| if (process.env.SHELL === '/bin/zsh') { | |
| console.log(' Please set environment variable NODE_PATH in ~/.zshrc:'); | |
| } else if (process.env.SHELL === '/bin/bash') { | |
| console.log(' Please set environment variable NODE_PATH in ~/.bashrc:'); | |
| } else { | |
| console.log(' Please set environment variable NODE_PATH:'); | |
| } | |
| console.log(); |
This file contains hidden or 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
| ex> | |
| npm install phantomjs-prebuilt@2.1.14 --ignore-scripts |
This file contains hidden or 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
| "use strict"; | |
| function makeBall(cb){ | |
| var arr = []; | |
| for(var i=1; i<=100; i++){ | |
| // if(!_.includes([1, 2, 3], i)) If any number is to be excluded ( _ by lodash ) | |
| arr.push(i); | |
| } | |
| cb(arr) | |
| } |
This file contains hidden or 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 randomIntFromInterval(min,max) | |
| { | |
| return Math.floor(Math.random()*(max-min+1)+min); | |
| } |
This file contains hidden or 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 zerofill(number, length) { | |
| // Setup | |
| var result = number.toString(); | |
| var pad = length - result.length; | |
| while(pad > 0) { | |
| result = '0' + result; | |
| pad--; | |
| } |
This file contains hidden or 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
| 'use strict'; | |
| var obj = { year: 2017 }; // year is user input | |
| function journey(a, cb){ | |
| a.country = "go usa"; | |
| cb(a); | |
| } | |
| function journey2(a, cb){ |
This file contains hidden or 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 dec2bin(dec){ | |
| return (dec >>> 0).toString(2); // >>> zero fill right shift due to signed bit | |
| } | |
| function bin2exclamation(bin){ | |
| var arr = []; | |
| for(var i=0; i< bin.length; i++){ | |
| arr.push(parseInt(bin.substr(i, 1)) === 1 ? 0 : 1); | |
| } | |
| return arr.join(''); |
This file contains hidden or 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
| // conf set | |
| "myredis" : "redis://myredis.com:6379" | |
| // process grep ex | |
| ps aux | grep redis-server | |
| kill -9 22292 | |
| ps -ef | grep -i 'redis-server' | |
| kill -9 PID owned by redis |
This file contains hidden or 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 names = ['Mike', 'Matt', 'Nancy', 'Adam', 'Jenny', 'Nancy', 'Carl'] | |
| const count = names => | |
| names.reduce((a, b) => | |
| Object.assign(a, {[b]: (a[b] || 0) + 1}), {}) | |
| const duplicates = dict => | |
| Object.keys(dict).filter((a) => dict[a] > 1) | |
| console.log(count(names)) // { Mike: 1, Matt: 1, Nancy: 2, Adam: 1, Jenny: 1, Carl: 1 } |
NewerOlder