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
export default { | |
/** | |
* @param {Vue} Vue | |
* @param {any} options | |
*/ | |
install(Vue, options) { | |
/** | |
* @typedef {object} MessageBox | |
* @property {boolean} confirmed - To be set true if confirmed, otherwise false | |
* @property {VueComponent} instance - Instance of VueComponent for $msgbox() |
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 ResponseBase = {}; | |
type SuccessResponse = ResponseBase & { data: any }; | |
type ErrorResponse = ResponseBase & { error: string }; | |
type Callback = (response: SuccessResponse | ErrorResponse) => void; | |
function call(callback: Callback) { | |
callback(<SuccessResponse> { data: {} }); | |
} | |
call(response => { |
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 FuckingPredeterminedMethodName(fuckinName: string) { | |
return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => { | |
target.__fuckingPredeterminedMethodNameCalled__ = target.__fuckingPredeterminedMethodNameCalled__ || {} | |
target.__fuckingPredeterminedMethodNameCalled__[fuckinName] = 0 | |
target[fuckinName] = function() { | |
if (++ target.__fuckingPredeterminedMethodNameCalled__[fuckinName] > 3) { | |
throw new Error('Stop it!') | |
} else { | |
console.warn(`Do not call me ${ fuckinName }.`) |
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 store = { | |
state: {}, | |
load() { | |
this.state = JSON.parse(localStorage.getItem('state')) | |
}, | |
watch(vm, key) { | |
return vm.$watch(key, (value) => { | |
localStorage.setItem('state', JSON.stringify(value)) |
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 persistedStore = { | |
state: {}, | |
load() { | |
this.state = JSON.parse(localStorage.getItem('state')) | |
}, | |
watch(vm, key) { | |
return vm.$watch(key, (value) => { |
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 Foundation | |
import AVFoundation | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
// NOTE: ~/Documents/Shared Playground Data/GeneralUser GS v1.471.sf2 | |
// http://schristiancollins.com/generaluser.php | |
let url = PlaygroundSupport.playgroundSharedDataDirectory.appendingPathComponent("GeneralUser GS v1.471.sf2") |
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 isValid() { | |
return ( | |
isSpecifiedUser() || | |
( | |
request.resource.data.privateKey1 == resource.data.privateKey1 && | |
request.resource.data.privateKey2 == resource.data.privateKey2 && | |
'publicKey' in request.resource.data | |
) | |
) && ( | |
request.resource.data.keys().hasOnly(['privateKey1', 'privateKey2' 'publicKey']) |
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/sh | |
if [[ "$1" != "up" ]]; then | |
exit 1 | |
fi | |
typing () { | |
text="$1" | |
length=${#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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Notification for SSM Session Manager | |
Globals: | |
Function: | |
Timeout: 60 | |
Parameters: |
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 | |
_puts() { | |
echo "$1" >&2 | |
} | |
# NOTE: https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/getting-started-configure-preferences-cli.html | |
ssm_configuration="$( | |
cat <<EOS | sed "s/__SESSION_LOGS_BUCKET__/$SESSION_LOGS_BUCKET/g" | |
{ |