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

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`
@Weiyuan-Lane
Weiyuan-Lane / v1_prompt.sh
Created July 2, 2023 05:58
V1 prompt script for testing
#!/bin/sh
promptGCPEntry(){
while true; do
read -p "Please input your Google Cloud Platform Project ID: " gcpProjectId
case $gcpProjectId in
"") echo "Please input a valid value.";;
* ) break;;
esac
done
package googletranslatewrapper
import (
"context"
"fmt"
"cloud.google.com/go/translate"
"github.com/weiyuan-lane/google-translate-api/internal/utils/errorhandlers"
)