I recently needed to extract a feature from a project to its own repo so I could publish as a standalone library:
# from
/some-project/src/some-folder/some-feature/*
import Vue from 'vue' | |
export function cached (target: Function) { | |
// get descriptors | |
const descriptors: any = Object.getOwnPropertyDescriptors(target.prototype) | |
const getters = Object | |
.keys(descriptors) | |
.filter(key => descriptors[key].get && !descriptors[key].set) | |
// we have getters! |
body { | |
padding-left: 400px; | |
} | |
div[class^=RebrandPlayerQueueItem__QueueItem] { | |
width: 400px; | |
} | |
div.player-height-placeholder div[class^=playerQueue__UpNextArea] { | |
z-index: 1000 !important; |
/** | |
* Helper function to reduce boilerplate in route creation | |
* | |
* @param {string} path The route's path | |
* @param {object} page A page component definition | |
* @param {Function} page A function that returns a page import | |
* @param {string} page A string path to a file in the view/pages folder | |
* @param {object} attrs Any additional attributes | |
*/ | |
export function route (path, page, attrs = {}) { |
cells (row, col, name) { | |
if (!this.hot) { | |
return null | |
} | |
const rowData = this.hot.getSourceDataAtRow(row) | |
if (rowData) { | |
if (rowData.state === NegotiationItemState.removed) { | |
return { readOnly: true } | |
} |
javascript: | |
` | |
WorkFlowy x 2 | |
============= | |
- A browser Bookmarklet to give you a dual panel WorkFlowy view | |
Features / Usage: |
// collection.js | |
export function forEach (arr, callback) { ... } | |
export function map (arr, callback) { ... } | |
export function get (arr, id, key = 'id') { ... } | |
export function getIndex (arr, id, key = 'id') { ... } | |
export function add (arr, item, index = -1) { ... } | |
export function update (arr, id, values) { ... } | |
export function move (fromArr, id, toIndex, toArr = fromArr) { ... } | |
export function moveByIndex (fromArr, fromIndex, toIndex, toArr = fromArr) { ... } | |
export function remove (arr, id) { ... } |
(function track (id) { | |
// prepare data | |
window.dataLayer = window.dataLayer || [] | |
function gtag () { dataLayer.push(arguments) } | |
gtag('js', new Date()) | |
gtag('config', id) | |
// load analytics | |
var script = document.createElement('script') |
<template> | |
<ui-icon name="notes" /> | |
<ui-icon name="book" /> | |
<ui-icon name="map" /> | |
</template> |
<template> | |
<ui-form name="address"> | |
<div class="fields"> | |
<ui-input | |
name="house_no" | |
label="House name / no" | |
:value.sync="values.house_no" |