Skip to content

Instantly share code, notes, and snippets.

View stevenvachon's full-sized avatar

Steven Vachon stevenvachon

View GitHub Profile
@stevenvachon
stevenvachon / error.txt
Last active August 5, 2020 20:26
TypeScript TS2515 error
ERROR in /grafana/packages/grafana-toolkit/test/fixtures/plugin/src/module.tsx
ERROR in /grafana/packages/grafana-toolkit/test/fixtures/plugin/src/module.tsx(11,44):
TS2344: Type 'DataSource' does not satisfy the constraint 'DataSourceApi<DataQuery, DataSourceJsonData>'.
Types of property 'query' are incompatible.
Type '(request: DataQueryRequest<DataQuery>) => Observable<DataQueryResponse>' is not assignable to type '(request: DataQueryRequest<DataQuery>) => Promise<DataQueryResponse> | Observable<DataQueryResponse>'.
Types of parameters 'request' and 'request' are incompatible.
Type 'import("/grafana/packages/grafana-toolkit/node_modules/@grafana/data/types/datasource").DataQueryRequest<import("/grafana/packages/grafana-toolkit/node_modules/@grafana/data/types/datasource").DataQuery>' is not assignable to type 'import("/grafana/packages/grafana-data/src/types/datasource").DataQueryRequest<import("/grafana/packages/grafana-toolkit/node_modules/@grafana/data/types/datasource").DataQuery>'.
@stevenvachon
stevenvachon / Toggle Dark Mode.applescript
Created May 20, 2020 21:32
Toggle between Terminal.app themes as macOS dark mode is changed
# I put this within an *.app file via Automator and added it to my user's "Login Items"
# It sets the theme every 5 minutes
repeat
tell application "System Events"
if dark mode of appearance preferences is true then
set terminalTheme to "custom_dark"
else
set terminalTheme to "custom_light"
end if
@stevenvachon
stevenvachon / README.md
Last active September 17, 2022 14:54
Apple Music/iTunes library audit

music-library-audit

Find file location errors within an Apple Music/iTunes library file.

This provides some insight into the "some of the songs were not imported because they could not be found" error.

Note: Only files referenced with file:// are supported. Any others will be reported as not found.

Installation

Node.js &gt;= 12 is required. Type this at the command line:

declare module '@finos/perspective-viewer' {
export interface PerspectiveViewer extends PerspectiveViewerOptions, HTMLElement {
load(data: TableData | Table, options?: TableOptions): void;
load(schema: Schema, options?: TableOptions): void;
update(data: TableData): void;
notifyResize(): void;
delete(delete_table: boolean): Promise<void>;
clear() : void;
replace(data: TableData) : void;
flush(): Promise<void>;
@stevenvachon
stevenvachon / yarnlink.ts
Last active December 14, 2019 23:05
grafana yarnlink
@stevenvachon
stevenvachon / async-await.js
Last active June 4, 2019 22:45
Compare these
try {
const resumes = await this.getResumes();
if (resumes.length > 0) {
this.setState({
resume: await this.getResume(resumes[0])
});
}
} catch(error) {
console.error(error);
@stevenvachon
stevenvachon / promises.js
Last active October 16, 2015 00:04
easy way to understand javascript promises
"use strict";
var p1 = new Promise( function(resolve) {
resolve();
});
var p2 = new Promise( function(resolve) {
resolve();
});