- 🚑
hotfix/
- for urgent bug fixes that merge directly into production - 🐛
bugfix/
- for bug fixes that merges to staging and then production - ✨
feature/
- to implement new feature - 🛠️
changes/
- to improve existing feature/code/algorithm - 📃
document/
- add/update documentation - 📦
deps/
- add/update dependencies
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 function mapListByProp<T extends object, K extends keyof T>(list: T[], key: K) { | |
const output = new Map<T[K], T[]>() | |
for (const item of list) { | |
if (!(key in item)) continue | |
const existingList = (output.has(item[key]) && output.get(item[key])) || [] | |
const updatedList = [...existingList, item] | |
output.set(item[key], updatedList) | |
} |
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 const freezeColumns = (table, options = {}) => { | |
options = { index: 5, offset: -0, ignoreClasses: ['groupingTableAmount', 'activebg'], ...options }; | |
const stickyIndex = options.index; | |
const rows = table?.querySelectorAll?.('tr'); | |
const testRow = table?.querySelectorAll?.('tbody tr')?.[0] ?? rows?.[0]; | |
const cellSlice = Array.prototype.slice.call(testRow.children, 0, stickyIndex); | |
const widthList = Array.prototype.map.call(cellSlice, (cell) => cell?.getBoundingClientRect()?.width); | |
const leftOffsetList = widthList.map((_, index) => { |
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
adam-bender.commit-message-editor | |
alefragnani.project-manager | |
arcsine.chronicler | |
Asuka.insertnumbers | |
bierner.emojisense | |
bodil.prettier-toml | |
bradlc.vscode-tailwindcss | |
bwildeman.tabulous | |
csstools.postcss | |
DavidAnson.vscode-markdownlint |
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 cloneDeep from 'lodash/cloneDeep'; | |
import forOwn from 'lodash/forOwn'; | |
import isEqual from 'lodash/isEqual'; | |
import memoize from 'lodash/memoize'; | |
import xorWith from 'lodash/xorWith'; | |
import { DateTime, Duration } from 'luxon'; | |
export const LOCALE = 'en-US'; | |
export const CURRENCY = 'USD'; | |
export const TIMEZONE_IANA = 'Asia/Kolkata'; |
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 stickyIndex = 5; | |
const rows = document.querySelectorAll("table tr"); | |
const cellSlice = Array.prototype.slice.call(rows[0].children, 0, stickyIndex); | |
const widthList = Array.prototype.map.call(cellSlice, (cell) => cell.offsetWidth); | |
const leftOffsetList = widthList.map((_, index) => { | |
const output = -10; | |
for (let i = 0; i < index; i++) output = output + (widthList[i] - 1); | |
return output; | |
}); |
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
Object.defineProperty(Number.prototype, 'decimal', { | |
get: function decimal() { | |
Number.precision = 'precision' in Number ? Number.precision : 3; | |
const f = Math.pow(10, Number.precision); | |
return Math.round(this * f) / f; | |
}, | |
}); |
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 class Action { | |
constructor(type) { | |
this.type = type; | |
} | |
emit(detail) { | |
const event = new CustomEvent(this.type, { detail }); | |
window.dispatchEvent(event); | |
} |
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
interface IAjaxCall { | |
error: boolean; | |
status: number; | |
data: any; | |
} | |
/** | |
* async api call helper | |
* @param func function that'll return promise | |
*/ |
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 | |
# cd to a directory where you want to install phoneGap | |
# and run following commands (or just download run this file with bash) | |
# https://github.com/phonegap/phonegap-app-desktop/commit/7a121fb96aef856cca36c6191778081e9d6317e5 | |
# https://github.com/phonegap/phonegap-app-desktop/commit/5ad750815ddf51e6cc8e557f46afb455e288b92e | |
sudo apt-get install libgconf-2-4 && | |
npm install -g grunt-cli && |