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 { PdfRenderer, PdfRendererFileReader } from './PdfRenderer'; | |
export abstract class Avery5160PdfRenderer extends PdfRenderer { | |
constructor(reader: PdfRendererFileReader) { | |
super(reader); | |
} | |
public async runDrawLabels(labels: unknown) { | |
await this.init(); | |
await this.drawLabels(labels); |
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
<mxfile host="app.diagrams.net" modified="2024-03-28T22:22:28.517Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" etag="oXXWV0pBanl8WLS-OPtp" version="24.0.4" type="device"> | |
<diagram name="Page-1" id="fbFyoZ6bNdFxacDbzJJn"> | |
<mxGraphModel dx="845" dy="878" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> | |
<root> | |
<mxCell id="0" /> | |
<mxCell id="1" parent="0" /> | |
<mxCell id="guI2NQdVJi73r4s4yvk4-1" value="«interface»<br><b>Interface1</b><div><hr>+method1</div><div>+method2</div><div>+method3</div><div>+method4</div><div><br></div>" style="html=1;whiteSpace=wrap;" vertex="1" parent="1"> | |
<mxGeometry x="30" y="160" width="110" height="130" as="geometry" /> | |
</mxCell> | |
<mxCell id="guI2NQd |
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 { override, addWebpackAlias } = require('customize-cra'); | |
const path = require('path'); | |
const overridePath = (webpackConfig) => { | |
const oneOfRule = webpackConfig.module.rules.find((rule) => rule.oneOf); | |
if (oneOfRule) { | |
const tsxRule = oneOfRule.oneOf.find( | |
(rule) => rule.test && rule.test.toString().includes('tsx') | |
); |
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 React from 'react'; | |
function withResizeAware(WrappedComponent) { | |
return class extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
height: document.documentElement.clientHeight, | |
width: document.documentElement.clientWidth |
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 React from 'react'; | |
import {withStyles} from '@material-ui/core/styles'; | |
import withResizeAware from '../../../core/withResizeAware'; | |
const styles = { | |
root: { | |
flex: 1, | |
padding: 10 | |
}, | |
container: { |
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
// algorithm question | |
// how to solve the buy - sell problem | |
// q: [3,5,6,9,2] | |
// a: 6 | |
// init best dff = 3-5 | |
// for each number in array | |
// loop each number after the number |
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
// convert a csv file to form like texts | |
// Convert a csv like this: | |
// Name,Age, Bob,30, John,40, | |
// To text like this: | |
// Name: Bob Age: 30 |
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
// convert a csv like array like this: | |
// const tourdates = [ | |
// ["date", "venue", "city"], | |
// ["jan 1", "paladium", "worcester"], | |
// ["jan 2", "irving", "nyc"], | |
// ["jan 3", "gramercy", "nyc"] | |
// ]; | |
// into objects, like this: |
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 fetch = require('node-fetch'); // fetch polyfill in node.js; not required in front end situation | |
// returns an promise, so it can be used by await | |
async function getTodo(id) { | |
return new Promise((resolve, reject) => { | |
fetch('https://jsonplaceholder.typicode.com/todos/' + id) | |
.then(response => response.json()) | |
.then(json => { | |
// success | |
// return data through resolve |
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 fetch = require('node-fetch'); // fetch polyfill in node.js; not required in front end situation | |
// returns an promise, so it can be used by await | |
async function getTodo(id) { | |
return new Promise((resolve, reject) => { | |
fetch('https://jsonplaceholder.typicode.com/todos/' + id) | |
.then(response => response.json()) | |
.then(json => { | |
// success | |
// return data through resolve |
NewerOlder