Skip to content

Instantly share code, notes, and snippets.

View adiwids's full-sized avatar

Adi Widyawan adiwids

View GitHub Profile
@adiwids
adiwids / Dockerfile
Created September 12, 2023 04:44
Dockerfile NextJS 13 production container
FROM node:18-bookworm AS DEPS_IMAGE
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install --no-package-lock
RUN npm prune --production
FROM node:18-bookworm AS BUILD_IMAGE
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /app

GET /shipments/1

{
  "shipment": {
    ...,
    "current_spal_version": 0,
    "pending_spal_revision": false,
    "spal_revisions": [
            ...,
            {

:ship_type = Tug, Barge, Spob, Suv, FloatingCrane :ship_type_id/:ship_id = Tug.id, dst

Webapp

POST /webapp/ships/document/upload Request

{
  :ship_type,
  :ship_id,
@adiwids
adiwids / get_ships_detail.json
Created May 13, 2020 17:33
GET /ships/{id}.json
{
"ship": {
"id": 1,
...
"shippable": {
"spob": {
"id": 1,
...
}
},
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Library/Ruby/rbenv/versions/2.2.7/bin/ruby -r
./siteconf20200106-70772-7jyxhc.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
{
"690": "CELLO SPORT BRA SALE",
"691": "CELLO SPORT BRA SALE",
"704": "T BACK SPORT BRA",
"705": "T BACK SPORT BRA",
"706": "T BACK SPORT BRA",
"863": "ARMY LEGGING",
"864": "ARMY LEGGING",
"865": "ARMY ANIMAL HOTPANT",
"866": "ARMY ANIMAL HOTPANT",
{
"SPORT BRAID SLINGPAD AVIAPAD": 0,
"NEON LEGGING 7/8": 0,
"LATEX LEGGING": 0,
"DW": 0,
"LEGGING PANJANG": 0,
"LEGGING 7/8": 0,
"CELLO SPORT BRA SALE": nil,
"T BACK SPORT BRA": nil,
"ARMY LEGGING": nil,
uc = Store.find_by code: 'UC'
# Orders on UC store
orders = Order.where(store_id: uc.id)
#305 records
# UC completed orders
completed = orders.where(state: ::Order.states[:completed])
#161 records
@adiwids
adiwids / gist:16c9ebcf7200ec31dec0976978f4e4dd
Last active July 22, 2019 22:35
vens_prod_cleanup_output.txt
irb(main):017:0> spr.delete_all
Report::SalesPerformanceSummary Update All (3.2ms) UPDATE "report_sales_performance_summaries" SET "deleted_at" = '2019-07-22 21:14:40.641294' WHERE "report_sales_performance_summaries"."deleted_at" IS NULL AND "report_sales_performance_summaries"."sales_id" IN ($1, $2, $3, $4, $5) [["sales_id", 68], ["sales_id", 31], ["sales_id", 45], ["sales_id", 67], ["sales_id", 59]]
=> 24
irb(main):018:0> dos.delete_all
Report::DailyOrderSummary Update All (2.7ms) UPDATE "report_daily_order_summaries" SET "deleted_at" = '2019-07-22 21:14:47.907106' WHERE "report_daily_order_summaries"."deleted_at" IS NULL AND "report_daily_order_summaries"."store_id" IN ($1, $2) [["store_id", 30], ["store_id", 24]]
=> 36
irb(main):019:0> auths.delete_all
UserAuthorization Update All (3.4ms) UPDATE "user_authorizations" SET "deleted_at" = '2019-07-22 21:14:51.600360' WHERE "user_authorizations"."deleted_at" IS NULL AND "user_authorizations"."user_id" IN ($1, $2, $3, $4, $5) [["user_id", 68], ["u
{
"order": {
"discount": 0,
"payment_method_uid": "91f17d19-7006-436c-8539-ee4663b4a8cb",
"shipment_attributes": {
"sender_detail": "Baju Senam Mutiara (081802050381)",
"id": "148",
"uid": "AAA7410F-6964-4BBE-AFB3-F4056B3EA718",
"fee": 12000,
"name": "Annisa tamara mufrodi",