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
| import {parse} from 'url'; | |
| import * as qs from 'qs'; | |
| const handleError = async response => { | |
| const message = await response.json(); | |
| return new Error(JSON.stringify({code: response.status, message})); | |
| }; | |
| const prefixer = (action: string) => [`PENDING_${action}`, `OK_${action}`, `ERR_${action}`]; | |
| export const GET = (action: string, url: string, query?: Object, hookOk = x => x, hookErr = x => x) => { |
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
| language: node_js | |
| node_js: | |
| - 'node' | |
| cache: | |
| yarn: true | |
| directories: | |
| - node_modules | |
| before_install: | |
| - curl -o- -L https://yarnpkg.com/install.sh | bash | |
| - export PATH=$HOME/.yarn/bin:$PATH |
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
| for f in **/*.js; do git mv "$f" "${f%.js}.ts"; done |
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
| { | |
| "sites": [{ | |
| "name": "Top Box Office (US)", | |
| "url": "http://www.imdb.com/chart/boxoffice", | |
| "stages": [{ | |
| "type": "list", | |
| "selector": "#boxoffice .titleColumn a", | |
| "attrs": { | |
| "value": "href" | |
| }, |
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 c = require('camelcase'); | |
| const p = require('pascalcase'); | |
| const src = '' //definition | |
| console.log( | |
| src | |
| .replace(/(\S+):/g, (_, $0) => `${c($0)}:`) | |
| .replace(/interface (\S+)/g, (_, $0) => `interface ${p(c($0))}`) | |
| ) |
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
| for I in ./*.asp ; do iconv -c -f euc-kr -t utf-8 $I > $I.tmp && mv $I.tmp $I ; done |
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 root = `${__dirname}/pages` | |
| const path = require('path') | |
| const tree = require('directory-tree') | |
| module.exports.exportPathMap = () => files(tree(root).children) | |
| .reduce((ret, file) => { | |
| ret[file] = {page: file} | |
| return ret | |
| }, {'/': {page: '/index'}}) |
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
| import {Middleware} from 'redux' | |
| import {CollectionInsertManyOptions, CollectionInsertOneOptions, MongoClient} from 'mongodb' | |
| export interface Argument { | |
| mongoDbUrl: string | |
| dbCollectionPrefix: string | |
| insertOneOptions?: CollectionInsertOneOptions | |
| insertManyOptions?: CollectionInsertManyOptions | |
| } |
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
| console.table( | |
| Array | |
| .from(document.querySelectorAll('.ty04 tr')) | |
| .map( | |
| tr => Array | |
| .from(tr.querySelectorAll('th,td')) | |
| .map(td => td.textContent) | |
| ) | |
| ) |
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
| echo ${CODEBUILD_BUILD_ID} | awk '{ print "{\"text\": \"빌드로그 <https://ap-northeast-2.console.aws.amazon.com/codebuild/home\?region\=ap-northeast-2\#/builds/" $1 "/view/new|" $1 ">\"}"}' | curl -H "Content-Type: application/json" -X POST -d @- https://api.dev.googit.co/common/send-to-channel-labs |