Skip to content

Instantly share code, notes, and snippets.

View yogithesymbian's full-sized avatar
✔️
scodeid - open source code id

Yogi Arif Widodo yogithesymbian

✔️
scodeid - open source code id
View GitHub Profile
"scripts": {
"build": "source $HOME/.nvm/nvm.sh; nvm use 12; vue-cli-service build",
"build:development": "source $HOME/.nvm/nvm.sh; nvm use 12; vue-cli-service build --mode development",
"start": "source $HOME/.nvm/nvm.sh; nvm use 18; vue-cli-service serve",
"start:production": "source $HOME/.nvm/nvm.sh; nvm use 18; vue-cli-service serve --mode production",
"lint": "source $HOME/.nvm/nvm.sh; nvm use 18; vue-cli-service lint",
"clean": "rm -rf package-lock.json && rm -rf node_modules && npm install --legacy-per-deps && npm run start",
"build:deploy": "source $HOME/.nvm/nvm.sh; nvm use 12 && npm run build && find ../visitor-dist -mindepth 1 ! -name '.git' ! -name '.gitignore' -exec rm -rf {} + && cp -R dist/* ../visitor-dist/"
},
@yogithesymbian
yogithesymbian / rp2040.md
Created February 16, 2025 02:46
raspberry pi 2040

Ya, untuk menambahkan JSON file board Raspberry Pi Pico di Arduino IDE, ikuti langkah-langkah berikut:

1. Buka Arduino IDE

Pastikan Anda sudah menginstal Arduino IDE versi 1.8.13 atau lebih baru.

2. Buka Preferences

  • Di Windows: Klik FilePreferences.
  • Di macOS: Klik Arduino IDEPreferences.

3. Tambahkan URL JSON

@yogithesymbian
yogithesymbian / .zshr
Created February 10, 2025 05:34
~/.zshr php config
laravel_pub() {
local IP=${1:-$(ipconfig getifaddr en0)} # Use argument if provided, otherwise get local IP
if [[ -z "$IP" ]]; then
echo "❌ Failed to determine IP address. Falling back to 127.0.0.1"
IP="127.0.0.1"
fi
echo "🚀 Starting Laravel on http://$IP:8000"
php artisan serve --host="$IP" --port=8000
@yogithesymbian
yogithesymbian / pi.md
Created February 5, 2025 22:29
pi.md

Ya, benar! Port USB-C di Raspberry Pi 4 Model B yang biasanya untuk power bisa juga digunakan untuk komunikasi data melalui USB Ethernet Gadget Mode.

Jadi, caranya:
Hubungkan kabel USB-C ke USB-C dari port USB-C di Raspberry Pi 4 ke port USB-C di MacBook M1.
✅ Raspberry Pi akan terdeteksi sebagai perangkat jaringan (Ethernet virtual) di MacBook.
✅ Setelah konfigurasi, kamu bisa SSH ke Raspberry Pi langsung via kabel USB-C tanpa perlu WiFi atau adapter tambahan.


Langkah-Langkah Konfigurasi "USB Ethernet Gadget Mode" di Raspberry Pi 4

@yogithesymbian
yogithesymbian / yo_aes_decrypt.rs
Created January 10, 2025 09:53
aes-256-cbc rust
use aes::Aes256;
use block_modes::{BlockMode, Cbc};
use block_modes::block_padding::Pkcs7;
use hex::{decode, encode};
use std::str;
// Define the type for AES-256-CBC
type Aes256Cbc = Cbc<Aes256, Pkcs7>;
fn main() {
@yogithesymbian
yogithesymbian / interview_reactjs.md
Last active January 8, 2025 07:43
Interview Questions For 𝐅𝐫𝐨𝐧𝐭𝐞𝐧𝐝 𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫 (𝐑𝐞𝐚𝐜𝐭 𝐉𝐒) 🚀 based on several interview compilation by Asim MahmoodAsim Mahmood

Interview Questions For 𝐅𝐫𝐨𝐧𝐭𝐞𝐧𝐝 𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫 (𝐑𝐞𝐚𝐜𝐭 𝐉𝐒) 🚀 based on several interview compilation by Asim MahmoodAsim Mahmood

1. Program to Reverse a String Without Using reverse()

function reverseString(str) {
  let reversed = "";
  for (let i = str.length - 1; i >= 0; i--) {
    reversed += str[i];
  }
 return reversed;
import React, { useState, useCallback, useMemo } from 'react';
import { render } from 'react-dom';
import React, { useReducer } from 'react';
const tableSearchReducer = (state, action) => {
switch (action.type) {
case 'SET_SEARCH':
return { ...state, search: action.payload };
case 'SET_COLUMN_SEARCH':
return { ...state, column_search: action.payload };
@yogithesymbian
yogithesymbian / eslint_clean_code.js
Created November 20, 2024 06:21
eslint config clean code
rules: {
complexity: ['error', { max: 6 }],
'max-depth': ['error', { max: 2 }],
'max-nested-callbacks': ['error', { max: 2 }],
'max-params': ['error', { max: 3 }],
'max-statements': ['error', { max: 12 }, { ignoreTopLevelFunctions: false }],
'max-len': ['error', { code: 120, ignoreUrls: true }],
'max-lines': ['error', { max: 200, skipComments: true, skipBlankLines: true }],
},
@yogithesymbian
yogithesymbian / remember.md
Created November 13, 2024 05:37
fvm flutter check needed
~/.gradle/wrapper/dists/
~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/
~/.fvm/versions/
@yogithesymbian
yogithesymbian / case1.md
Created August 23, 2023 05:21
git my case
  1. i have create new branch from master yesterday, and its local on my pc.
  2. today in master gitlab have new updates
  3. how should i do

A. Update Your Local Master Branch:

git rebase main  
error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.