Skip to content

Instantly share code, notes, and snippets.

View josephschmitt's full-sized avatar

Joe Schmitt josephschmitt

View GitHub Profile
from:
@uc/thrift2npme/dist/dms/activity_log/activity_log_service
to:
@uc/thrift2npme/dist/activity_log/activity_log_service
from:
@uc/thrift2npme/dist/dms/dms_common/dms_communication
to:
@uc/thrift2npme/dist/dms_common/dms_communication
@josephschmitt
josephschmitt / 01_ci_step.thrift
Last active July 6, 2022 20:29
Brainstorming Thrift source code that generates Segment event definitions and client SDK's
namespace go tech_infra.ci.step
// CI Step has started
struct Started {
// Name of the CI step being run
1: required string name;
} (
analytics.method = "track"
)
@josephschmitt
josephschmitt / push-chunks.sh
Created April 8, 2022 18:15
Splits commits into chunks to push. Useful for when needing to push a ton of commits to a remote all at once.
#!/usr/bin/env bash
# Adjust the following variables as necessary
REMOTE=test-repo
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
@josephschmitt
josephschmitt / switch_brew.sh
Last active September 23, 2021 16:15
Function to update the PATH to point to the "correct" brew installation depending on architecture
# This function is for use on Macs with multiple brew installations (usually M1/arm64) Macs. This
# function will attempt to set your brew PATH to point to the correct brew based on the system arch.
#
# Usage:
# # will automatically set brew based on architecture
# $ switch_brew
#
# # will set brew for arm64
# $ switch_brew arm64
#
# Usage:
# $ switch_brew (uname -m)
# $ switch_brew x86_64
# $ switch_brew arm64
function switch_brew
set -l arm_brew_path "/opt/homebrew/bin"
set -l switch_to $argv[1]
if test "$switch_to" = "x86_64"
if set -l index (contains -i $arm_brew_path $PATH)
coverage:
precision: 2
round: down
range: 70...100
status:
default_rules:
flag_coverage_not_uploaded_behavior: exclude
project:
svcs_cron_video_year_in_review:
flags:
@josephschmitt
josephschmitt / 100.fish
Last active February 8, 2021 15:55
Fish config
function 100
echo "
|--------------------------------------------- 100 ------------------------------------------------|
"
end
@josephschmitt
josephschmitt / script.md
Last active April 14, 2020 18:50
How to create a new `JoeDemoService` backend service in 7 easy steps...

Node GRPC Demo Script

How to create a new JoeDemoService backend service in 7 easy steps...

  1. Create new thrift file in ~/development/urbancompass/src/thrift/urbancompass/joe_demo:
namespace go joe_demo.joe_demo_service
namespace java com.urbancompass.joe_demo
namespace js joe_demo.joe_demo_service
// By default, use a try/catch with async await
try {
await someRemoteAction();
} catch (e) {
console.error(e);
}
// If you need to store the result of an async/await AND you want the catch to be a specific value...
const myResult = await someRemoteAction().then(() => 'some-value').catch(() => 'some-error-value');
// myResult will equal 'some-value' on success, but 'some-error-value' on error
checks:
- hydra/dependencies:
required: true
- hydra/owners:
required: true
- hydra/package.json:
required: true
- hydra/quarantine:
required: true
- hydra/dockerfile