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 { useRoute } from 'vue-router' | |
const route = useRoute() | |
export default function useRouteQuery () { | |
return { | |
getRouteQuery (key: string) { | |
const { [key]: value } = route.query | |
return Array.isArray(value) ? value[0] : 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 arr = ['love', 'lovec', 'wlovec', 'asdlov123', 'abc123'] | |
const word = 'love' |
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 PATH=~/.npm-global/bin:$PATH | |
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH" | |
export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH" | |
alias ll='ls -lh' | |
alias dockerps="docker ps -a --format \"table {{.ID}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}\"" | |
eval "$(/opt/homebrew/bin/brew shellenv)" |
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 crypto from 'crypto' | |
const x509Certificate = '[insert certificate here]' | |
const certificateStrings = x509Certificate.match(/-----BEGIN CERTIFICATE-----\s*([\s\S]+?)\s*-----END CERTIFICATE-----/i) | |
if (certificateStrings && certificateStrings[1]) { | |
throw new Error('Invalid certificate') | |
} | |
const sha1Thumbprint = crypto |
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
# http://editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
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 AWSLambda from 'aws-sdk/clients/lambda' | |
import { mode, modeIsDev } from '@/environment' | |
import type AWSSES from 'aws-sdk/clients/ses' | |
const lambda = new AWSLambda({ | |
endpoint: modeIsDev ? 'http://localhost:3002' : undefined | |
}) | |
const response = await lambda.invoke({ | |
FunctionName: `myApi-${mode}-email`, |
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
output.split('').slice(0, -3).join('') + '.000' | |
Ex: | |
'1000000'.split('').slice(0, -3).join('') + '.000' // 1000.000 | |
'100000'.split('').slice(0, -3).join('') + '.000' // 100.000 | |
'10000'.split('').slice(0, -3).join('') + '.000' // 10.000 |
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
# Functions to disable/enable scroll | |
scrollPreventDefault = (e) -> | |
e = e or window.event | |
if e.preventDefault | |
e.preventDefault() | |
e.returnValue = false | |
keydown = (e) -> | |
t = [37,38,39,40] |
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($){ | |
'use strict'; | |
$.fn.applySelect2 = function() { | |
this.filter('.select2-no-search').each(function(){ | |
var options = $(this).data('options') || {}; | |
$.extend( options, { minimumResultsForSearch: -1 } ); | |
$(this).data('options', options); |
NewerOlder