Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Still working from home; but no travel

Steven Vachon stevenvachon

🏠
Still working from home; but no travel
View GitHub Profile
@stevenvachon
stevenvachon / error.txt
Last active Aug 5, 2020
TypeScript TS2515 error
View error.txt
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
Toggle between Terminal.app themes as macOS dark mode is changed
View Toggle Dark Mode.applescript
# 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 Feb 25, 2020
Apple Music/iTunes library audit
View README.md

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.

Installation

Node.js >= 12 is required. Type this at the command line:

npm install gist:ff9ed11603303ef66fd67a9a2b02a1bf -g
View @finos--perspective-viewer--index.d.ts
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 Dec 14, 2019
grafana yarnlink
View yarnlink.ts
View async-await.js
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 Oct 16, 2015
easy way to understand javascript promises
View promises.js
"use strict";
var p1 = new Promise( function(resolve) {
resolve();
});
var p2 = new Promise( function(resolve) {
resolve();
});
You can’t perform that action at this time.