Homebrew build doesn't work -- dunno why. I should figure out why and fix it then submit a PR, but I'm lazy.
brew install cmake libtool pkg-config check gengetopt help2man pcsc-lite openssl
function showAgent() { | |
echo The current SSH agent is $(readlink ~/.ssh-agent-link) | |
} | |
function updateSshAgentSock() { | |
NEWSOCK=$2 | |
if [ -z "$NEWSOCK" ]; then | |
echo -n "No socket found for ${1}; not changing agents. " | |
return 1 | |
elif [ ! -S "$NEWSOCK" ]; then |
# Enable gzip compression | |
apiVersion: traefik.containo.us/v1alpha1 | |
kind: Middleware | |
metadata: | |
name: gzip-compress | |
spec: | |
compress: {} |
export const readOnlyExcludeKeysModel = <const>[ | |
'watch', 'bulkWrite', 'create', 'createCollection', | |
'syncIndexes', 'listIndexes', 'ensureIndexes', | |
'createIndexes', 'findByIdAndRemove', 'findByIdAndDelete', | |
'findByIdAndUpdate', 'findOneAndRemove', 'findOneAndDelete', | |
'findOneAndUpdate', 'insertMany', 'remove', 'deleteOne', | |
'deleteMany', 'replaceOne', 'update', 'updateMany', 'updateOne', | |
]; | |
export type readOnlyExcludeKeysModel = typeof readOnlyExcludeKeysModel[number]; | |
export const readOnlyExcludeKeysDoc = <const>[ |
import mongoose, { LeanDocument } from "mongoose"; | |
import '@/lib/PromiseAll'; | |
// Used because Object.keys doesn't give us types for field names | |
export function keys<T extends object>(obj: T) : (keyof T)[] { | |
return Object.keys(obj) as (keyof T)[]; | |
} | |
// Spelled incorrectly on purpose | |
const defaultIgnoreType = '__UNMODIFEID__'; |
// excerpt, not full file | |
@schemaDef({ | |
indexes: [ | |
[{ session_def: 1, sequence_num: 1, owner: 1 }, { unique: true }], | |
[{ start_date: 1, end_date: 1 }], | |
[{ owner: 1, date: 1, session_def: 1, sequence_num: 1 }], | |
[{ password: 1, date: 1 }, { sparse: true }], | |
[{ date: 1 }], | |
], |
// Object.fromEntries polyfill, if you use this your tsconfig.json probably will need to be | |
// updated with something like this in compilerOptions (using this with node 10.17): | |
// "lib": [ | |
// "ES2018", "ES2019.Object", | |
// ] | |
function ObjectFromEntries<A extends PropertyKey, B>(iter: [A, B][]) : Record<A, B> { | |
const obj: Record<A, B> = {} as any; | |
for (const pair of iter) { |
export const velist = { | |
"anchorage": "Anchorage Amateur Radio Club", | |
"arrl": "American Radio Relay League (ARRL)", | |
"cavec": "Central America CAVEC, Inc.", | |
"golden": "Golden Empire Amateur Radio Society", | |
"lagroup": "Greater L.A. Amateur Radio Group", | |
"jefferson": "Jefferson Amateur Radio Club", | |
"laurel": "Laurel Amateur Radio Club, Inc", | |
"mrac": "MRAC VEC, Inc", |
These types are forked from the current (as of Jan 2020) mongoose types on definitelytyped; they add things like automatic handling of "lean" documents (including toObject) and advanced types for filter and update queries
Well, I want to and I think we should, but I'm hesitant to try to push it through because there are some breaking
class ReadAheadIterator<T extends any> implements AsyncIterator<T> { | |
currentQ: Promise<T>[] = []; | |
constructor(private readNext: Iterator<Promise<T>>, private readAheadCount: number = 5) { | |
this.readAhead(); | |
} | |
[Symbol.asyncIterator]() { return this; } | |
readAhead() { | |
while (this.currentQ.length < this.readAheadCount) { |