Skip to content

Instantly share code, notes, and snippets.

View remy727's full-sized avatar
🏠
Working from home

Remy Wang remy727

🏠
Working from home
View GitHub Profile
@remy727
remy727 / install_ngrok.md
Created May 6, 2024 14:19 — forked from russorat/install_ngrok.md
How to install ngrok on linux subsystem for windows
@remy727
remy727 / looking-for-ror-backend-developer.md
Last active March 1, 2024 10:01
Ruby on Rails Backend developer

The Opportunity:

We're hiring Backend Engineers who will be working on Ruby on Rails API apps. But sometimes also work on non-RoR app such as Sinatra or pure Ruby scripts. The developer will be working closely with me.

What you will do:

  • Build RESTful APIs to support our front end team
  • Take care of error handling and fixing real bugs on production
  • Take ownership of the system health, monitoring and performance
@remy727
remy727 / yeti-orders.md
Created February 25, 2024 12:45
API request and response examples sent from Order Split App on Yeti

Y977989-1

API request
{"order": {"name": "Y977989-1", "tags": "braze_block", "email": "yalahgilly@gmail.com", "currency": "AUD", "tax_lines": [{"rate": 0.1, "price": 2.27, "title": "GST"}], "total_tax": 2.27, "line_items": [{"id": 13851852701830, "sku": "21071501919", "name": "Rambler® 10 oz (296 ml) Tumbler - Power Pink", "grams": 300, "price": "25.00", "title": "Rambler® 10 oz (296 ml) Tumbler", "duties": [], "vendor": "YETI", "taxable": true, "quantity": 1, "gift_card": false, "price_set": {"shop_money": {"amount": "25.00", "currency_code": "AUD"}, "presentment_money": {"amount": "25.00", "currency_code": "AUD"}}, "product_id": 5137824678022, "properties": [], "variant_id": 40236113854598, "pre_tax_price": "22.73", "variant_title": "Power Pink", "product_exists": true, "total_discount": "0.00", "current_quantity": 1, "pre_tax_price_set": {"shop_money": {"amount": "22.73", "currency_code": "AUD"}, "presentment_money": {"amount": "22.73", "currency_code": "AUD"}},
@remy727
remy727 / get-country-name-from-country-code.js
Created February 11, 2024 12:54
Get Country name from Country code using JavaScript
const regionNames = new Intl.DisplayNames(
['en'], {type: 'region'}
);
console.log(regionNames.of('US')); // 👉️ "United States"
console.log(regionNames.of('GB')); // 👉️ "United kingdom"
console.log(regionNames.of('DE')); // 👉️ "Germany"
console.log(regionNames.of('AU')); // 👉️ "Australia"
@remy727
remy727 / app-proxy-verification-concern.rb
Created January 30, 2024 18:32
App Proxy Verification
module AppProxyVerification
extend ActiveSupport::Concern
included do
skip_before_action :verify_authenticity_token, raise: false
before_action :verify_request
end
private
@remy727
remy727 / retrieve-shopify-app-uninstall-surveys.rb
Last active January 5, 2024 19:12
Retrieve Shopify App uninstall surveys
org_id = 'your_org_id'
access_token = 'your_partner_api_access_token'
api_version = 'shopify_api_version' # example: '2024-01'
app_id = "gid://partners/App/your_app_id"
occurred_at_min = 'specific_time' # example: '2024-01-02T23:15:27.000000Z'
uri = URI("https://partners.shopify.com/#{org_id}/api/#{api_version}/graphql.json")
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
@remy727
remy727 / show-order-additional-details-in-notification-on-shopify.liquid
Created November 29, 2023 11:56
Show order additional details in notification on Shopify
{% for attribute in attributes %}
{% assign key = attribute | first | downcase | strip %}
{% if key == "your_attribute_name" %}
Your attribute name: {{ attribute | last }}
{% endif %}
{% endfor %}
@remy727
remy727 / shopify-rest-admin-api-example.rb
Created November 23, 2023 14:16
Shopify REST Admin API Example
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails"
@remy727
remy727 / detect-the-client-s-device-using-shopify-app-bridge-utilities.js
Created November 6, 2023 09:35
Detect the client's device using Shopify App Bridge Utilities
import {
isShopifyEmbedded,
isMobile,
isShopifyMobile,
isShopifyPOS
} from '@shopify/app-bridge/utilities';
const onShopifyEmbedded = isShopifyEmbedded();
const onMobile = isMobile();
const onShopifyMobile = isShopifyMobile();
@remy727
remy727 / heroku-alternatives.md
Last active November 28, 2023 15:33
Heroku Alternatives