Skip to content

Instantly share code, notes, and snippets.

View yudistiraashadi's full-sized avatar

Yudistira Ashadi yudistiraashadi

  • Surabaya, Indonesia
View GitHub Profile
@yudistiraashadi
yudistiraashadi / setup-next-js-and-other.md
Last active May 21, 2024 01:59
Setup Next.js dan antek-antek

Next.js

Install Next.js npx create-next-app@latest. Masukkan nama project, pilih yes semua kecuali yg terakhir (custom @), pilih no.

Mantine (UI Component Library)

Install Mantine.dev di link ini. Pilih packages yg diinginkan, biasanya: hooks, core, dates, notifications, modals. Copy dependencies command untuk install dibawahnya serta dev-dependencies command. Gunakan --save-exact agar version specific. Scroll kebawah terus untuk setup Mantine.

  • (PENTING!) Apabila menambahkan packages lain, masuk ke page packages tersebut dan setup packages tersebut juga.

  • Rubah global.css menjadi seperti ini:

// 1. Pastikan local supabase sudah linked dengan supabase online
// 2. `npx supabase storage ls ss:///[bucket-name]/[path-to-folder]/ --experimental`
// 3. Copy semua nama file pada storage di array images_tournaments_logos atau rename sesuai keinginan
import { createClient } from '@supabase/supabase-js'
const supabaseOnline = createClient("[URL-SUPABASE-ONLINE]", "[SUPABASE-ONLINE-ANON-KEY]");
const supabaseSelfHost = createClient("[URL-SUPABASE-SELF-HOST]", "[SUPABASE-SELF-HOST-ANON-KEY]");
const images_tournaments_logos = [
@yudistiraashadi
yudistiraashadi / supabase_sync_sat_set.md
Last active September 25, 2024 17:28
Sync Supabase command e tok

RUN DI LOCAL:

  1. npx supabase init untuk setup supabase folder dan config.
  2. npx supabase start untuk setup Docker (download docker image + setup)
  3. npx supabase db pull --db-url [connection-string-asal] untuk memastikan diff dari db remote dan local sesuai
  4. npx supabase db pull [(optional) migration-name] --db-url [connection-string-asal]
  5. npx supabase db pull [(optional) migration-name] --db-url [connection-string-asal] --schema auth,storage
  6. npx supabase db dump --data-only -f supabase/seed.sql --db-url [connection-string-asal]
  7. (untuk update DB existing) npx supabase db push --db-url [connection-string-tujuan]
  8. (untuk DB baru dari 0) npx supabase db reset --db-url [connection-string-tujuan]
@yudistiraashadi
yudistiraashadi / supabase_sync.md
Last active May 3, 2024 09:05
Sync supabase online - local - self host (3 way)

1. Requirement

  • Terdapat Supabase instance di online / local / self host (salah satu)
  • Ter install node.js serta Docker pada mesin local

 

2. Sync ke local

Step ini dilakukan apabila supabase ada di online / self host. Step ini dapat di skip apabila sudah ada di local.

  • Pada directory yang anda inginkan, run npx supabase init untuk setup supabase folder dan config.
@yudistiraashadi
yudistiraashadi / Check_remote_Git.md
Last active January 31, 2025 13:46
Check if pull needed in Git

Check if pull needed in Git

First use git remote update, to bring your remote refs up to date. Then you can do one of several things, such as:

  1. git status -uno will tell you whether the branch you are tracking is ahead, behind or has diverged. If it says nothing, the local and remote are the same.

  2. git show-branch *master will show you the commits in all of the branches whose names end in 'master' (eg master and origin/master).

If you use -v with git remote update (git remote -v update) you can see which branches got updated, so you don't really need any further commands.

@yudistiraashadi
yudistiraashadi / xclip_ssh_rsa.sh
Created October 4, 2018 14:58 — forked from orendon/xclip_ssh_rsa.sh
linux copy ssh rsa key, xclip xsel pbcopy
xclip -sel clip < ~/.ssh/id_rsa.pub
# in case you get a display null error
DISPLAY=:0 xclip -sel clip < ~/.ssh/id_rsa.pub
# osx
pbcopy < ~/.ssh/id_rsa.pub
@yudistiraashadi
yudistiraashadi / vs-code-css-comments-snippet.json
Last active November 17, 2021 06:05
CSS comments snippet for VS Code
{
"comment": {
"prefix": "comment",
"body": [
"/** ${1:Comment} */"
],
"description": "Single comment block"
},
"comment-super-section": {
"prefix": "comment-super-section",
@yudistiraashadi
yudistiraashadi / homestead-manual-install.md
Created December 2, 2017 02:49 — forked from idecardo/homestead-manual-install.md
Laravel Homestead Manual Installation

Getting Started

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. Read more...

Download

Download homestead box using this link: