Skip to content

Instantly share code, notes, and snippets.

View rveitch's full-sized avatar

Ryan Veitch rveitch

View GitHub Profile
@rveitch
rveitch / nvm-auto-run.md
Created April 6, 2023 19:01 — forked from tcrammond/nvm-auto-run.md
Automatically nvm use when entering directory

Calling nvm use automatically in a directory with a .nvmrc file

Put this into your $HOME/.zshrc to call nvm use automatically whenever you enter a directory that contains an .nvmrc file with a string telling nvm which node to use:

place this after nvm initialization!

@rveitch
rveitch / mermaidtest.md
Created October 19, 2022 18:48
Mermaid Test

UML diagrams

You can render UML diagrams using Mermaid. For example, this will produce a sequence diagram:

sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob-->>John: How about you John?
Bob--x Alice: I am good thanks!
Bob-x John: I am good thanks!
const clusterUrls = ['http://127.0.0.1:9000', 'https://badserver.fail'];
(async () => {
const healthCheckPromises = clusterUrls.map((clusterUrl) => checkServerHealth(clusterUrl));
const results = await Promise.allSettled(healthCheckPromises);
return results;
})();
/**
@rveitch
rveitch / ShipLog.md
Created October 6, 2021 21:00
ShipLog
classDiagram
	class Organization
	class Team
		Team: +int organizationId
		Team: +array LabelsText
    class User
	    User: +int teamId
	class Repo
 Repo: +int organizationId
@rveitch
rveitch / google-ads-api_tester.js
Created July 2, 2021 02:49
Google-Ads-Api example
/* eslint-disable no-debugger, no-console */
process.env.GRPC_VERBOSITY = 'DEBUG';
process.env.GRPC_TRACE = 'all';
const {
GoogleAdsApi,
services: { KeywordSeed },
} = require('google-ads-api'); // package v5.2.0 = Google Ads API to v7
const Env = require('../../config/env.js');
@rveitch
rveitch / google_ads_node_keywords_example.js
Created July 1, 2021 14:59
Google Ads Node Generate Keyword Ideas Exampke
const {
GoogleAdsClient,
GenerateKeywordIdeasRequest,
KeywordSeed,
} = require('google-ads-node'); // v2.0.4
const { StringValue } = require('google-protobuf/google/protobuf/wrappers_pb'); // v3.14.0
(async () => {
// Client
const oGoogleAdsClient = new GoogleAdsClient({
@rveitch
rveitch / Convert To WordPress Stats.md
Created June 18, 2021 22:42
Convert To WordPress Stats

Convert to WordPress Jobs: June 11 2020 - June 18 2020

Summary

  • 196 jobs in 7 days. (Approx 6-800 per month)
  • 85% gdoc, 15% wysiwyg (text editor)
  • All conversions were made by 40 Unique calendars ids
  • The top 5 calendar ID's made 63% of all requests, the top 10 calendar ID's made 75% of all requests

Stats

@rveitch
rveitch / twinkle-loop.sh
Last active November 23, 2020 21:20 — forked from cpmpercussion/loop_pi_video.sh
omxplayer command to loop a video forever for use in video art exhibitions
#!/bin/bash
omxplayer --loop --vol -1300 -o asla /home/pi/twinkle-long.mp3
# omxplayer --loop --vol -1300 -o asla /home/pi/twinkle-long.mp3 &
@rveitch
rveitch / morningstar_mc6_midi_program_mapper.js
Last active November 9, 2020 19:29
Morningstar MC6 Midi Program Mapper
const MIDI_OFFSET = 1;
const BANK_MIN = 1;
const BANK_MAX = 30;
const PRESETS_PER_BANK = 12; // CC# 10-21, Presets A-L
const PRESET_MIN = 10; // Control Change # - Preset A
const PRESET_MAX = 21;// Control Change # - Preset L
const CONTROL_CHANGE_VALUE = 1; // Control Change Value - (1 = On Press)
function getBank(incomingProgramChange) {
return Math.floor(incomingProgramChange / PRESETS_PER_BANK) + MIDI_OFFSET;
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// MIT License
//
// This example shows how to deserialize a JSON document with ArduinoJson.
#include <iostream>
#include "ArduinoJson.h"
int main() {