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
for I in ./*.asp ; do iconv -c -f euc-kr -t utf-8 $I > $I.tmp && mv $I.tmp $I ; done |
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 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 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 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 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 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 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
#!/usr/bin/env node | |
const crypto = require('crypto'); | |
const alg = 'aes-256-ctr'; | |
const usage = _ => { | |
console.log('[usage]'); | |
['c', 'd'].map(opt => console.log(` ${exe} -${opt} secret payload`)); | |
process.exit(); | |
}; | |
const [_, exe, opt = '-h', secret, payload] = process.argv; |
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 FormData = require('form-data'); | |
const fetch = require('node-fetch'); | |
const cheerio = require('cheerio'); | |
const problem = problem => new Promise(async (resolve, reject) => { | |
try { | |
const result = await fetch(`http://www.4clojure.com/problem/${problem}`); | |
const html = await result.text(); | |
const $ = cheerio.load(html); | |
const number = $('#prob-number').text(); |
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
aws ecs stop-task --cluster FoxCrane --region ap-northeast-1 --task `aws ecs list-tasks --cluster FoxCrane --region ap-northeast-1 | grep arn | node -e "i = process.stdin; i.resume(); i.on('data', data => console.log(data.toString().trim().replace(/\"/g, '')));"` |
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
docker build -t deptno/capturer . && docker tag deptno/capturer:latest 874372296913.dkr.ecr.ap-northeast-1.amazonaws.com/deptno/capturer:latest && docker push 874372296913.dkr.ecr.ap-northeast-1.amazonaws.com/deptno/capturer:latest |