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 | |
var https = require('https'); | |
var client_id = process.env.NAVER_CLIENT_ID; | |
var client_secret = process.env.NAVER_SECRET; | |
var host = 'openapi.naver.com'; | |
var port = 443; | |
var uri = '/v1/language/translate'; | |
var text = process.argv.slice(2).join(" "); |
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 | |
function howOldAreYou(birth, employment, joinArmy, discharge) { | |
if (arguments.length !== 4) { | |
console.log(`arguments[yyyy-mm-dd]: 생일, 취업일, 입대, 전역`); | |
process.exit(); | |
} | |
var dateBirth = new Date(birth); | |
var dateEmployment = new Date(employment); | |
var dateJoinArmy = new Date(joinArmy); | |
var dateDischarge = new Date(discharge); |
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
body, ebong { | |
background-color: red; | |
} |
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 fetch from 'node-fetch'; | |
export const toSlack = (event, context, callback) => { | |
const {target, message} = event; | |
if (!target || !message) { | |
return callback(ex, 'Error'); | |
} | |
const options = { headers: {'Content-Type': 'application/json'}, method: 'POST', body: JSON.stringify({text: message}) }; | |
return fetch(target, options) |
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
rm deploy.zip && zip -r --exclude=.git\* --exclude=.idea\* deploy . && aws lambda update-function-code --function-name handlerS3ObjectCreated --zip-file fileb://${PWD}/deploy.zip --region ap-northeast-1new |
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 --region ap-northeast-1 --cluster FoxCrane --task arn:aws:ecs:ap-northeast-1:874372296913:task/fd0b3b24-31db-4073-880e-41158bd312d7 |
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 |
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
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
#!/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; |