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
# 例如要搜尋第一個符號 "[git tag" 開頭且結尾是 "]" 字元的字串,而且用非貪婪的 regular expression 方式,grep 中要加 "-P" 參數 | |
# Linux | |
grep -o -P "\[git tag .*?\]" | |
# MacOS 只能用 egrep ,因為 grep 沒有 "-P" 參數 | |
egrep -o "\[git tag .*?\]" | |
# 執行成功顯示訊息用 "&&" 串起來,若失敗用 "||" 接著串,潔簡的表達成功或失敗該顯示什麼訊息或執行什麼指令 | |
npx projen build && echo "::set-output name=conclusion::success" || echo "::set-output name=conclusion::failure" |
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 * as cdk from '@aws-cdk/core'; | |
/** | |
* Using other type of secrets of AWS Secrets Manager | |
*/ | |
const gitHubToken = cdk.SecretValue.secretsManager('arn:aws:secretsmanager:ap-northeast-1:your account id:secret:cusotm-name-YWWmII', { | |
jsonField: 'your key name', | |
}) | |
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
var urlRequest = ""; | |
if (window.location.port) { | |
urlRequest = window.location.protocol + "//" + window.location.host + ":" + window.location.port + window.location.pathname; | |
} else { | |
urlRequest = window.location.protocol + "//" + window.location.host + window.location.pathname; | |
} |
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
#!/bin/bash | |
AWS_CODECOMMIT_URL="git-codecommit.us-east-1.amazonaws.com/v1/repos" | |
if [ $(git rev-parse --is-bare-repository) = true ] | |
then | |
REPOSITORY_BASENAME=$(basename "$PWD") | |
REPOSITORY_DIRNAME=$(basename $(dirname "$PWD")) | |
else | |
REPOSITORY_BASENAME=$(basename $(readlink -nf "$PWD"/..)) |
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
@Media (min-width: 1200px) { | |
} | |
@Media (min-width: 980px) and (max-width: 1199px) { | |
} | |
/* 平板電腦、橫向手機和一般桌機解析度 */ | |
@Media (min-width: 768px) and (max-width: 979px) { |
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
<?php | |
$ftpHost = ''; //ftp主機名稱 | |
$ftpId = ''; //ftp帳號 | |
$ftpPwd = ''; //ftp密碼 | |
$remote_file = preg_replace('/\?|:|\/|\\\|\*|"|\||<|>/', '', $remote_file); | |
//$remote_file = iconv('UTF-8','BIG5',$remote_file); | |
$remote_file = iconv('UTF-8','gb2312',$remote_file); | |
$ftpDir = ''; | |
$remote_send_file = $ftpDir.trim($remote_file); //傳到遠端的檔名 |
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
<?php | |
/* | |
* Plugin: StreamlineFoundation | |
* | |
* Class: Schedule | |
* | |
* Description: Provides scheduling mechanics including creating a schedule, testing if a specific moment is part of the schedule, moving back | |
* and forth between scheduled moments in time and translating the created schedule back to a human readable form. | |
* | |
* Usage: ::fromCronString() creates a new Schedule class and requires a string in the cron ('* * * * *', $language) format. |