Skip to content

Instantly share code, notes, and snippets.

View airhorns's full-sized avatar
🎯
Workin' on Gadget at https://gadget.dev

Harry Brundage airhorns

🎯
Workin' on Gadget at https://gadget.dev
View GitHub Profile
#21 0.382 yarn run v1.22.5
#21 0.410 $ rm -rf packages/web/dist/* && NODE_ENV=production yarn workspace web webpack
#21 0.862 $ /app/node_modules/.bin/webpack
#21 1.823 (node:52) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
#21 1.823 (Use `node --trace-deprecation ...` to show where the warning was created)
#21 36.85 internal/fs/utils.js:628
#21 36.85 throw err;
#21 36.85 ^
#21 36.85
#21 36.85 TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received '/app/node_modules/es5-ext/string/\x00#/contains'
query issues {
id
name
filter timeLogs by timeSpent > 10 {
timeSpent
level
} then group by level {
sum(timeSpent)
} then filter by deletedAt is not set and publishedAt < NOW()
then sort by timeSpent Descending
@airhorns
airhorns / yarn.lock
Created July 21, 2020 13:10
snowpack webpack debugging
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.8.3":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a"
integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==
dependencies:
"@babel/highlight" "^7.10.4"
/** Wrapper class that creates an introspectable promise that can be used to suspend */
export class Suspender<T> {
debug = false;
promise: Promise<T>;
finished = false;
rejected = false;
resolution: T | null = null;
rejectReason: any = null;
id = id++;
@airhorns
airhorns / PromiseModel.ts
Last active July 5, 2020 23:55
mobx-state-tree Promise model
import { cast, flow, IAnyType, Instance, SnapshotOrInstance, types } from "mobx-state-tree";
import { assert } from "../lib/utils";
let counter = 0;
const RejectReasontype = types.maybe(types.frozen<Error>());
/**
* `mobx-state-tree` promise model factory that is observable and plays nice with the atomic middleware. Useful for embedding in the tree to fetch data on demand and reporting it's availability. It's kind of like an Apollo graphql query, but purely just state, more general, and observable.
* __Note__: This is different than normal `Promise`s because this is a factory: it produces one class of promise (a mst model) where instances of the model get configured with arguments to then execute that specific instancce
*/
declare let window: any;
const _global = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : {};
const NativeWebSocket = _global.WebSocket || _global.MozWebSocket;
import Backoff from "backo2";
import { default as EventEmitterType, EventEmitter, ListenerFn } from "eventemitter3";
import { ExecutionResult } from "graphql/execution/execute";
import { DocumentNode } from "graphql/language/ast";
import { print } from "graphql/language/printer";
import { getOperationAST } from "graphql/utilities/getOperationAST";
@airhorns
airhorns / browserless-lighthouse.ts
Created January 8, 2020 20:41
Browserless-token authentication for lighthouse
import https from 'https';
import WebSocket from 'ws';
import log from 'lighthouse-logger';
import queryString from 'query-string';
import LighthouseError from 'lighthouse/lighthouse-core/lib/lh-error';
import ChromeProtocol from 'lighthouse/lighthouse-core/gather/connections/cri';
const CONNECT_TIMEOUT = 10000;
log.setLevel('info');
export const dataURIMime = (uri: string) => {
return uri.split("")[0].slice(5);
};
export const dataUriToBlob = (uri: string) => {
const data = uri.split(",")[1];
const bytes = atob(data);
const buffer = new ArrayBuffer(bytes.length);
let array = new Uint8Array(buffer);
@airhorns
airhorns / 1_todo.rb
Last active June 12, 2019 23:48
Example Ruby files for RnD Camp Style Exercise
class Todo
def initialize(*argv)
@argv = argv
begin
send(@argv[0])
rescue TypeError
list
rescue NoMethodError
puts "Command #{@argv[0]} not found.\n\n"
@airhorns
airhorns / Gemfile.lock
Created February 25, 2019 17:30
Fellow shipit gemfile
GIT
remote: https://github.com/airhorns/shipit-engine.git
revision: 2ecd45860f989828041eeb317947f71d8c40c68d
ref: tail-task-fix
specs:
shipit-engine (0.27.0)
active_model_serializers (~> 0.9.3)
ansi_stream (~> 0.0.6)
attr_encrypted (~> 3.1.0)
autoprefixer-rails (~> 6.4.1)