Custom command for https://starship.rs/
Show git user email Very useful when you're working for several organizations with difference git settings
{"tgs":1,"v":"5.5.2","fr":60,"ip":60,"op":240,"w":512,"h":512,"nm":"!!!!12","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":6,"ty":4,"nm":"core","parent":8,"sr":1,"ks":{"p":{"a":0,"k":[-11,192,0]},"a":{"a":0,"k":[-12,192.429,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":60,"s":[{"i":[[51.25,10.429],[47.25,35.25]],"o":[[5.5,-8.321],[29,7.5]],"v":[[-49.75,163],[-79.75,106.179]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":74,"s":[{"i":[[51.983,10.645],[36.75,139.5]],"o":[[-1,14.429],[-14.517,22.717]],"v":[[-77.983,110.033],[-31.233,57.212]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":75,"s":[{"i":[[52.25,9.179],[36.75,139.5]],"o":[[-1,14.429],[-11.25,22]],"v":[[-80,106.25],[-34.25,64.429]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":89,"s":[{"i":[[2.5,5.429],[36.75,139.5]],"o":[[-1,14.429],[-1,5.5]],"v":[[-35.5,58.5],[-29.25,57.679]],"c":true}]},{"i":{"x":0 |
Custom command for https://starship.rs/
Show git user email Very useful when you're working for several organizations with difference git settings
// For example, I use Dependency Injection pattern in my architecture of node.js app | |
import asyncRedis from 'async-redis' | |
import { Container } from 'typedi' | |
const client = asyncRedis.createClient(config.redis) | |
Container.set('redis', client) |
Vue.filter('priceFormat', function (val) { | |
if (typeof val !== 'number' && typeof val !== 'string') return val | |
if (typeof val === 'string') val = parseInt(val) | |
const res = Math.round(val * 100) / 100 | |
return res.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ') | |
}) |
computed: { | |
UTM() { | |
const { query } = this.$route | |
let res = '/?' | |
let index = 0 | |
for (let key in query) { | |
if (index > 0) res += `&` | |
res += `${key}=${query[key]}` |
const binarySearch = (arr: number[], val: Number) => { | |
let start: number = 0, | |
end: number = arr.length - 1, | |
middle: number | |
while (start < end) { | |
middle = Math.floor((+start + +end) / 2) | |
if (val <= arr[middle]) { | |
end = middle |