Skip to content

Instantly share code, notes, and snippets.

@hedcet
hedcet / patent-maintenance-fees.sql
Last active July 22, 2025 04:45
USPTO Patent Maintenance Fees - Week Summary
WITH CurrentWeek AS (
SELECT
DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY) AS first_day,
DATE_ADD(DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY), INTERVAL 6 DAY) AS last_day
)
SELECT
fm.customerNumber AS "Customer No",
CASE WHEN fm.nameLineTwo IS NOT NULL AND fm.nameLineTwo != '' THEN CONCAT(fm.nameLineOne, ' ~ ', fm.nameLineTwo) ELSE fm.nameLineOne END AS "Law Firm / Entity Name",
SUM(CASE WHEN fp.feeStatus = 'Due' THEN 1 ELSE 0 END) AS "Missed Surcharge Date (Due)",
SUM(CASE WHEN fp.feeStatus IN ( 'Late', 'Unpaid') THEN 1 ELSE 0 END) AS "Missed Close Date (Unpaid)",
@hedcet
hedcet / clear.history.js
Last active July 9, 2025 05:32
clear github copilot web conversation/context history to solve vertical scrolling issue
for(const i of [...document.querySelectorAll('[class^="ConversationList-module__ConversationList__item-"] button')].reverse()) {
i.click();
await new Promise(r => setTimeout(r, 1000));
document.querySelectorAll('[class^="prc-ActionList-ActionListItem-"]')[1].click();
await new Promise(r => setTimeout(r, 1000));
document.querySelectorAll('[class^="prc-ConfirmationDialog-ConfirmationFooter-"] button')[1].click()
}
export const colors = [
{ 'background-color': '#000000', color: '#FFFFFF' },
{ 'background-color': '#000033', color: '#FFFFFF' },
{ 'background-color': '#000066', color: '#FFFFFF' },
{ 'background-color': '#000099', color: '#FFFFFF' },
{ 'background-color': '#0000CC', color: '#FFFFFF' },
{ 'background-color': '#0000FF', color: '#FFFFFF' },
{ 'background-color': '#003300', color: '#FFFFFF' },
{ 'background-color': '#003333', color: '#FFFFFF' },
{ 'background-color': '#003366', color: '#FFFFFF' },
@hedcet
hedcet / global-dossier-doc-code-group-mapping.json
Last active May 30, 2025 10:23
global-dossier docCodeGroup to docCode mapping
{
"1": {
"US": {
"SPEC": "Specification",
"371P": "Documents submitted with 371 (National Stage) Applications",
"ABST": "Abstract",
"CLM": "Claims",
"DRW": "Drawings-only black and white line drawings",
"P.N.101.CONV": "PCT/RO/101 - Request form for new International Application - Conventional",
"EARLYPUB": "Request for Early Publication",
@hedcet
hedcet / testlink-xmlrpc.js
Created March 31, 2023 07:31
example for testlink-xmlrpc npm package
@hedcet
hedcet / overlay.png
Last active February 19, 2023 11:29
RoughJS pie chart with legends
overlay.png
@hedcet
hedcet / clear-history.js
Last active March 7, 2025 19:17
delete chrome browser history from console
// select render'd history items
document.querySelector('history-app').shadowRoot.querySelector('history-list').shadowRoot.querySelector('iron-list').querySelectorAll('history-item').forEach(i => i.shadowRoot.querySelector('cr-checkbox').click());
// click toolbar delete button
document.querySelector('history-app').shadowRoot.querySelector('history-toolbar').shadowRoot.querySelector('cr-toolbar-selection-overlay').shadowRoot.querySelector('cr-button').click();
// document.querySelector('history-app').shadowRoot.querySelector('history-toolbar').shadowRoot.querySelector('cr-toolbar-selection-overlay').fire_('delete-selected');
// click delete dialog remove button
document.querySelector('history-app').shadowRoot.querySelector('history-list').shadowRoot.querySelector('cr-button.action-button').click();
// 3s delay
await new Promise(r => setTimeout(r, 3000));
// error free load more
@hedcet
hedcet / app.service.ts
Last active April 7, 2023 06:29
nedb(async/await) with nestjs
import { Inject, Injectable } from '@nestjs/common';
import { nedb } from './db.providers';
@Injectable()
export class AppService {
constructor(
@Inject('NEDB')
private readonly db: typeof nedb
) {