Skip to content

Instantly share code, notes, and snippets.

View Weiyuan-Lane's full-sized avatar
🐈
Code. Code! CODE! CODE!!!!!!

Weiyuan Liu Weiyuan-Lane

🐈
Code. Code! CODE! CODE!!!!!!
View GitHub Profile
@Weiyuan-Lane
Weiyuan-Lane / json_to_graph.rb
Created May 17, 2024 04:58
Transform JSON payload to a graph file
#!/usr/bin/ruby
# To run in terminal:
#
# `ruby json_to_graph.rb <json_input_file_path> <output_path>`
#
#
# Make sure you install the following gems:
#
# `gem install ruby-graphviz`
@Weiyuan-Lane
Weiyuan-Lane / code_assistants_comparison.md
Last active June 10, 2024 03:50
Comparison of all code assistants!

Hotel Results Sorting & Filtering task

Introduction

To write the application you should use JS and any frontend framework that may help you to achieve the display. It should work in the web browser. There should be no/ minimal server side rendering here.

You can post it as a gist, upload to github or send us via email, anything works as long as the code is correct and you send us instructions how to use it.

Background & Requirements

@Weiyuan-Lane
Weiyuan-Lane / google_sheet_count_formula.md
Last active December 24, 2023 09:31
How to perform counts across a row or column in Google Sheet
=QUERY(A2:A, "
SELECT 
  A, COUNT(A) 
WHERE 
  A IS NOT NULL AND 
  A != 'Others (Custom)' 
GROUP BY 
  A 
ORDER BY 
Section Summary
What is Duet AI? Introduces what "Duet AI" is. We cover the multiple pr
@Weiyuan-Lane
Weiyuan-Lane / gke_comparing_management_tools.md
Last active December 24, 2023 10:44
Comparing different management tools when using GKE
Method Cloud Console Kubectl Kubernetes Dashboard K9s
CRUD usage (Functionality) ✅❌❌ ✅✅✅ ✅✅❌ ✅✅✅
Metrics Dashboard (Functionality) ✅✅✅ ❌❌❌ ✅✅✅ ✅❌❌
Declarative deployments (Functionality) ❌❌❌ ✅✅✅ ❌❌❌ ❌❌❌
Ease of setup (Usability) ✅✅✅ ✅✅❌ ✅❌❌ ✅✅❌
User interface (Usability) ✅✅✅ ❌❌❌ ✅✅✅ ✅✅❌
Uptime (Reliability) ✅✅✅ ✅✅✅ ✅✅❌ ✅✅✅
Self-hosted (Reliability) ❌❌❌ ✅✅✅ ✅✅❌
@Weiyuan-Lane
Weiyuan-Lane / prompt_user_input.sh
Created July 2, 2023 08:02
Reusable script for prompting user imput, supported with cache
#!/bin/sh
TMP_DIR=".tmp"
mkdir -p $TMP_DIR
PROMPT_DIR="prompt"
mkdir -p $TMP_DIR/$PROMPT_DIR
# INPUT VARIABLES
# $1 - Global variable name to write prompt into
# $2 - Input prompt message for user
#!/bin/sh
TMP_DIR=".tmp"
PROMPT_DIR="prompt"
mkdir -p $TMP_DIR
mkdir -p $TMP_DIR/$PROMPT_DIR
promptUserEntry(){
local _outputVar=$1
local _inputPrompt=$2
#!/bin/sh
TMP_DIR=".tmp"
mkdir -p $TMP_DIR
promptGCPEntry(){
local _gcpIDCacheFilename="$TMP_DIR/gcpprojectid"
if [ -e $_gcpIDCacheFilename ]; then
gcpProjectId=`cat $_gcpIDCacheFilename`