Skip to content

Instantly share code, notes, and snippets.

View BertiKarsunke's full-sized avatar

Yi Seong Zin BertiKarsunke

  • Seoul
View GitHub Profile
@BertiKarsunke
BertiKarsunke / refreshAppleAuth.mjs
Last active May 3, 2022 04:29
refresh Apple authentication For Fastlane with google zx
#!/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;
@BertiKarsunke
BertiKarsunke / retrieve_fastlane_session.rb
Created January 3, 2022 05:35 — forked from gaelfoppolo/retrieve_fastlane_session.rb
Auto-setting FASTLANE_SESSION on CI
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
@BertiKarsunke
BertiKarsunke / alias
Last active January 15, 2021 02:32
[shell] zsh
We couldn’t find that file to show.
@BertiKarsunke
BertiKarsunke / Webstorm
Last active July 28, 2019 07:16
[IDE] Jetbrain
//deployment exclued path
.svn;.cvs;.idea;.DS_Store;.git;.hg;*.hprof;*.pyc;node_modules;package-lock.json;*.log;.vscode
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;
}
@BertiKarsunke
BertiKarsunke / mongoexport
Created March 29, 2019 02:41
[mongo] csv export
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
^javascript:GoSNAChannel\('([A-Z|0-9]+')\, 'http:\/\/category.gmarket.co.kr\/listview\/LList\.aspx\?gdlc_cd=[0-9]+\'\)\;
@BertiKarsunke
BertiKarsunke / slack-push-logs.sh
Created March 18, 2019 02:49 — forked from replsv/slack-push-logs.sh
Slack log file watcher
#!/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
@BertiKarsunke
BertiKarsunke / puppeteer-click-by-text.js
Created March 18, 2019 01:28 — forked from tokland/puppeteer-click-by-text.js
Click link by text in Puppeteer
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})]`);