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
#!/usr/bin/env zx | |
console.warn("restore apple credential : start") | |
//need env files | |
const content = await fs.readFile('.env', 'utf8') | |
const env_array = content.split("\n") | |
let email; |
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
lane :retrieve_fastlane_session do | |
# runs shell | |
# this needs SPACESHIP_SKIP_2FA_UPGRADE=1 flag | |
spaceauth_output = `bundle exec fastlane spaceauth` | |
# regex the output for the value we need | |
fastlane_session_regex = %r{Pass the following via the FASTLANE_SESSION environment variable:\n(?<session>.+)\n\n\nExample:\n.+} | |
new_session = nil | |
if match = spaceauth_output.match(fastlane_session_regex) | |
# strip out the fancy formatting |
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
//deployment exclued path | |
.svn;.cvs;.idea;.DS_Store;.git;.hg;*.hprof;*.pyc;node_modules;package-lock.json;*.log;.vscode |
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
process.env.NODE_ENV = ( process.env.NODE_ENV && ( process.env.NODE_ENV ).trim().toLowerCase() == 'production' ) ? 'production' : 'development'; | |
if (process.env.NODE_ENV == 'production') { | |
CONFIG = CONFIG.production; | |
console.log("Production Mode"); | |
} else if (process.env.NODE_ENV == 'development') { | |
console.log("Development Mode"); | |
CONFIG = CONFIG.development; | |
} |
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
mongoexport --host localhost --db gmarket --collection item --type=csv --out gmarket_item.csv --fields title,site,referrer,previouslocation,html,href,date,cooki e,adsect,url |
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
^javascript:GoSNAChannel\('([A-Z|0-9]+')\, 'http:\/\/category.gmarket.co.kr\/listview\/LList\.aspx\?gdlc_cd=[0-9]+\'\)\; |
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
#!/bin/bash | |
SLACK_HOOK_URL="https://hooks.slack.com/services/SOME/SPECIAL/TOKEN" | |
SLACK_CHANNEL="#production-logs" | |
tail -n0 -F "$1" | while read LINE; do | |
(echo "$LINE") && curl -X POST --silent --data-urlencode \ | |
"payload={\"channel\": \"$SLACK_CHANNEL\", \"mrkdwn\": true, \"text\": \"$(echo $LINE | sed "s/\"/'/g") | File: ${1} | Server: $(hostname)\"}" $SLACK_HOOK_URL; | |
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 puppeteer = require('puppeteer'); | |
const escapeXpathString = str => { | |
const splitedQuotes = str.replace(/'/g, `', "'", '`); | |
return `concat('${splitedQuotes}', '')`; | |
}; | |
const clickByText = async (page, text) => { | |
const escapedText = escapeXpathString(text); | |
const linkHandlers = await page.$x(`//a[contains(text(), ${escapedText})]`); |