Skip to content

Instantly share code, notes, and snippets.

View simudin's full-sized avatar
🤠
howdy pardner!

Hasim Sofaruddin simudin

🤠
howdy pardner!
View GitHub Profile

QA Notes: LLM Configuration

Since our DB is reseted everyday, QA team need to set the AI Configuration everyday before start the testing.

Use this Config for AI:

  • LLM Name: gemini-1.5-flash
  • Input Token Price: 0.075
  • Output Token Price: 0.3
  • Token Limit Threshold: 128000
  • Per Token Count: 1000000
  • Currency: USD
@simudin
simudin / soft_delete_duplicated_users.rb
Last active March 2, 2020 11:24
soft delete duplicated users
# script for soft delete all duplicated users(user with no pass_purchases)
# container for duplicated user ids
duplicated_user_ids = []
# pluck all uniq loyalty_id
unique_loyalty_ids = User.distinct.pluck(:loyalty_id)
# iterate through unique_loyalty_ids
unique_loyalty_ids.each do |loyalty_id|
@simudin
simudin / send_redeemed_redemption_code_to_redis.rb
Last active February 29, 2020 10:57
send redeemed code to redis in case the code is not redeemed and did not sent to redis because of system crash
# send redeemed code to redis in case the code is
# not redeemed and did not sent to redis because of system crash
# run this script in rails console of one of the deals web pods
offer = Offer.find(313) # 313 current id of unlimited redemption of flight bundle offer
redis_existed = 0 # create variables for counting the existed promo in redis
redis_not_existed = 0 # create variables for counting the not exsisted promo in redis
# get all redeemed redemption code of the offer
# refer to: https://github.com/touristly/deals/blob/master/web/app/models/redemption_code.rb#L10
@simudin
simudin / assign_promo_code_to_user.rb
Last active March 6, 2020 11:14
push the redemption code to redis in case there's user that still not assigned the promo code and push them to promo redis service
# push the redemption code to redis-
# in case there's user that still not assigned the promo code and-
# push them to promo redis service
# run this script in rails console of one of the deals web pods
offer = Offer.find(313) # 313 current id of flight bundle offer
pass_id = offer.pass_offers.first.pass_id # pass_id should be 12, the current id of flight bundle pass
# get all user id of user that has purchase the flight bundle
check_user_ids = PassPurchase.where(pass_id: pass_id, status: "confirmed").map(&:user_id)
shouldn't create a user when facebook_id or google_id is taken: "errors" => [{"resource" => "Authentication", "field" => "uid","code" => "has already been taken"}]
user should be error for duplicated a user: errors: [{resource: "User", field: "email", code: "is_taken"},{resource: "User",field: "username",code: "is_taken"}]}.to_json)
user should be error for bad password: errors: [{resource: "User", field: "password", code: "contains_username"},{resource: "User", field: "password", code: "is_too_short"}, {resource: "User", field: "password", code: "is_invalid"}]}.to_json)
when organization membership code doesn't exist: errors: [{resource: "User", field: "organization_membership_code", code: "not_existing"},
when organization membership code is taken: errors: [{resource: "User", field: "organization_membership_code", code: "is taken"},
when organization membership code is inactive: errors: [{resource: "User", field: "organization_membership_code", code: "inactive"},
when new username is over 20 characters: err
"errors": {
"connection": "Please check your internet connection and try again.",
"invalid_request": "An invalid request is sent. Please check entered data.",
"server_error": "We are very sorry but our server is having problems. Please try again later.",
"login_error": "Could not login. Please check your username and password.",
"info": "There was a problem connecting to the server.<br />Try refreshing the page, or logging out.",
"unauthorized_feature": "You do not have access to this feature yet!",
"activation_not_found": "Invalid activation code, please input the correct activation code or continue with another payment option",
"404": {
"header": "Oops! Page not found",