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
function myFunction() { | |
var youremail = "youremail@example.com"; | |
var mailtitle = "Portal Submission Review Progress"; | |
var subjectqueries = { | |
"submit" : 'in:anywhere from:"Ingress Operations", subject:"Ingress Portal Submitted: "', | |
"review" : 'in:anywhere from:"Ingress Operations", subject:"Portal review complete: "', | |
"Live" : 'in:anywhere from:"Ingress Operations", subject:"Ingress Portal Live: "', | |
"Reject" : 'in:anywhere from:"Ingress Operations", subject:"Ingress Portal Rejected: "', | |
"accept" : 'in:anywhere from:"Ingress Operations", "1000 AP"' |
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
tell application "Finder" | |
set display_size to bounds of the window of the desktop | |
end tell | |
(* bounds == {0, 0, width, height} *) | |
set width to item 3 of display_size | |
set height to item 4 of display_size | |
set editor to { name : "Sublime Text", top : 0, height : height * 0.8 } | |
set terminal to { name : "Terminal", top : height * 0.8, height : height * 0.2 } |
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
// Google App Scriptの実行トリガーを時間主導型の1分ごとに設定する | |
function myFunction(){ | |
//AgentIDとYoNameの対応リストを自力で作成 | |
var AgentList = { | |
"Agent1" : "yoname1", | |
"Agent2" : "yoname2" | |
}; | |
//履歴保存用スプレッドシート指定 |
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
# Add or custome for your .bashrc | |
source ~/.vagrant-prompt.sh | |
export PS1='\u@\h \W\[\033[33m\]$(__vagrant_pt)\[\033[00m\] $ ' |
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
# filename => abc012ABC~`!@#$%^&*()_+-={}[]|":;'?><,./マルチバイトxyz | |
# url => https://gist.github.com/KamataRyo/e087a7b3d070a04704126a87e302dbe1#file-abc012abc-_-xyz |
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
imort $switch from '@kamataryo/extypes/Object/$switch' | |
'ABC'[$switch] | |
.case('abc', () => console.log('not matched..')) | |
.case('ABC', () => console.log('matched!')) | |
.default(() => console.log('not matched..')) |
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
/** | |
* タイムアウト機能を埋め込むプロキシ | |
* targetが一定時間呼ばれなかったら固有の処理を実行する | |
* タイムアウトすると、呼ばれた回数のカウンタはリセットされる | |
* @param {function} target プロキシされる関数 | |
* @param {{timeout: number, callback: function}} opts オプション | |
* @return {function} プロキシされた関数 | |
*/ | |
const timeoutProxy = (target, opts) => { | |
/** |
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
ZIP_FILENAME="./archive-$npm_package_version.zip" | |
rm -rf node_modules | |
npm install --only=prod | |
zip -r $ZIP_FILENAME node_modules index.js | |
aws lambda create-function \ | |
--function-name $AWS_LAMBDA_FUNCTION_NAME \ | |
--runtime nodejs10.x \ | |
--role $AWS_LAMBDA_ROLE \ |
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 wait = (msec: number) => | |
new Promise(resolve => setTimeout(resolve, msec)); | |
const catched = Symbol("is-catched"); | |
const delayPromise = (promise: Promise<any>, msec: number) => { | |
const catchedPromise = promise.catch(err => ({ [catched]: err })); | |
return Promise.all([catchedPromise, wait(msec)]).then(result => { | |
if (result[0][catched]) { |
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
type Ref = { message?: string; isValid?: boolean }; | |
const isValid = (value: any, ref: Ref): value is string => { | |
if (typeof value === "string") { | |
if (value.length > 10) { | |
ref.isValid = false; | |
ref.message = "Value should have length less than 10."; | |
} else { | |
ref.isValid = true; | |
ref.message = "OK"; |
OlderNewer