Skip to content

Instantly share code, notes, and snippets.

View 4sskick's full-sized avatar
🏠
Working from home

tian 4sskick

🏠
Working from home
View GitHub Profile
Debounce based on https://medium.com/swlh/using-a-debounced-callback-in-react-ade57d31ca6b
@4sskick
4sskick / decode_URL_encoded
Last active May 21, 2025 08:10
parse dynamic URL encoded key value
let's say got string encoded URL like this
'pData%5B0%5D%5Bvalue%5D=&pData%5B0%5D%5Bname%5D=MultiAllowanceDetailOriginalEmployeeMultiAllowanceRecordList&pData%5B1%5D%5Bvalue%5D=MultiAllowanceDetail&pData%5B1%5D%5Bname%5D=MultiAllowanceDetailItemCode&pData%5B2%5D%5Bvalue%5D=true&pData%5B2%5D%5Bname%5D=MultiAllowanceDetailHasMultipleRecord&pData%5B3%5D%5Bvalue%5D=00000000-0000-0000-0000-000000000000&pData%5B3%5D%5Bname%5D=MultiAllowanceDetailRecordID&pData%5B4%5D%5Bvalue%5D=787b382e-bf20-f011-bad0-06d40d699a17&pData%5B4%5D%5Bname%5D=MultiAllowanceDetailParentRecordID&pData%5B5%5D%5Bvalue%5D=A&pData%5B5%5D%5Bname%5D=MultiAllowanceDetailDataChangeType&pData%5B6%5D%5Bvalue%5D=%7B%22OriginalEmployeeMultiAllowanceRecordList%22%3A%5B%7B%22RecordID%22%3A%22d524d01f-1983-e811-99c4-f430b99edb31%22%2C%22TargetRecordID%22%3A%22d524d01f-1983-e811-99c4-f430b99edb31%22%2C%22ParentRecordID%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22AllowanceCode%22%3A%22%23AR_BASC%22%2C%22DateStart%22%3A%222018-02-23T00%3A00%3A00%2
@4sskick
4sskick / delete_unwanted_suffix_name_file_of_project.md
Last active August 18, 2025 06:28
listing `unwanted` file with suffix name on path then delete

I just download the project folder from website, but it the filename being duplicate which like main.ts and main.ts.Identifier. So instead of delete one-by-one, I just listing all the file then delete directly.

  • save in sh extension

#!/bin/bash dir=${1:-.} find "dir" -type f -name "*.Identifier" -exec rm -f {} ;

  • done finish, run with command sh .sh /path/of/project
@4sskick
4sskick / share-git-on-stash.md
Last active September 2, 2026 08:52
Export stash as a file, and apply it to another computer

It’s 5 PM, you are knee-deep in optimistic UI rendering for FamilyVault, and you need to log off before the Jakarta traffic peaks. You have a dozen uncommitted files, but pushing a broken "WIP" commit to your remote repository just to pull it on your laptop later pollutes your git history; instead, you can physically extract your work-in-progress state and drop it onto another machine.

1. Box up your current work Capture everything on your active machine, including brand-new utility scripts that Git isn't tracking yet.

  • GUI: Select Git > Stash > Stash (Include Untracked)
  • Terminal:
git stash push --include-untracked
@4sskick
4sskick / Error: listen EADDRINUSE: address already in use.md
Last active August 18, 2025 06:28
Error: listen EADDRINUSE: address already in use

so this issue will clearly tell you that the address or port is in use by another program or task service process. The error will tell you oike this,

Error: listen EADDRINUSE: address already in use 127.0.0.1:9323
    at Server.setupListenHandle [as _listen2] (node:net:1372:16)
    at listenInCluster (node:net:1420:12)
    at GetAddrInfoReqWrap.doListen (node:net:1559:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8) {
  code: 'EADDRINUSE',
  errno: -4091,
 syscall: 'listen',
@4sskick
4sskick / macOS Error: Operation not permitted
Last active September 23, 2024 04:21
macOS Error: /bin/bash: bad interpreter: Operation not permitted
so when doing development on react native platform (iOS), I do build then failed with error operation not permitted on file react-native-xcode.sh (under react-native/scripts folder). Confuse and have no idea how to solve, because I am new using xCode IDE.
Looking for resolution issue but hesitant because am not really familiar with mac OS system. After some reading on resolution I am confident to execute some command for resolve the issue.
So the file is on quarantine attribute because I ever see content of file using 'cat' which leading to edit the script using textEdit *excuse my knowledge on this*
so to resolve the issue you need to make sure is the file (react-native-xcode.sh) is appear on list then execute command `xattr -l react-native-xcode.sh`
if so, then you need to remove react-native-xcode.sh under xattr command using `xattr -d react-native-xcode.sh`
make sure again using `xattr -l react-native-xcode.sh` then build
ref:
- https://web.archive.org/web/20240225084013/https://www.codingcatlady.net/20
@4sskick
4sskick / React Native index.android.bundle.md
Last active August 18, 2025 06:29
index.android.bundle need to generate everytime generate application file variant release

so, in react native specific platform Android, they gonna read bundled file which generated by minified of index.js to make it smoother when aplication run. If somehow the index.android.bundle file not found, you can generate by your self.

run command npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle

it will generate fil index.android.bundle under folder android/app/src/main/assets

after finish, can run using release version apk file or using command npx react-native run-android --variant=release

ref:

@4sskick
4sskick / SQL import large file.md
Last active August 18, 2025 06:29
import large file SQL

I have SQL file with size 16GB, but can't import directly using SQL server management tools. So sqlcmd is the saviour!! simply just run the command with following format

sqlcmd -S ‘your server name’ -U ‘user name of server’ -P ‘password of server’ -d ‘db name’-i ‘script.sql’ -a 32767

in may case would be

@4sskick
4sskick / OkHttp 3 implementation of Volley's HttpStack - OkHttpStack.java
Last active June 19, 2024 22:28 — forked from NightlyNexus/OkHttpStack.java
OkHttp 3 implementation of Volley's HttpStack
/*
* Copyright (C) 2016 Eric Cochran
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@4sskick
4sskick / React Native From Scratch!
Last active July 24, 2024 06:18
React Native Project from Scratch!
- make sure to use nvm, you can read from here (https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/)
- by the time I write this (30.04.24), react native latest version 0.74
- If you read the documentation guide (https://reactnative.dev/docs/environment-setup?guide=native), need to use minimum version node 18
- I use version node 20, by install using `nvm install 20.12.2`
- then use the downloaded version node, `nvm use 20.12.2`
- don't forget to install yarn, if you're using it `npm install --global yarn`
- all set!!
- ready to setup and start typing `npx react-native@latest init projectName`
- or if you wanna specify the version react native to use add `--version 0.73`
- `npx react-native@latest init projectName --version 0.73`