Skip to content

Instantly share code, notes, and snippets.

View abdulhadad's full-sized avatar

Abdul Hadad abdulhadad

View GitHub Profile
@abdulhadad
abdulhadad / github_user_info.html
Created September 2, 2024 10:07
github_user_info.html
<!doctype html>
<body>
<style>
.alert {
padding: 15px;
border: 1px solid #d6e9c6;
border-radius: 4px;
color: #3c763d;
background-color: #dff0d8;
}
@abdulhadad
abdulhadad / githubinfo.js
Last active September 2, 2024 09:57
github user info
// berhasil
let login = 'adobe'
fetch(`https://api.github.com/users/${login}`)
.then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));
// gagal
let login = 'asdasdasdasdasdasd'
fetch(`https://apixxxxxxx.github.com/users/${login}`)
@abdulhadad
abdulhadad / README.md
Created December 28, 2023 07:19
application.yml with configmap data
  • for local development
  • read env config from configmap data section
  • replace application.yml with configmap data
@abdulhadad
abdulhadad / trimcompact.js
Created May 22, 2023 06:09
JS string trim and compact
" Text with spaces ".replace(/ +/g, ' ').trim()
@abdulhadad
abdulhadad / windows_update_hotspot_fix_june_2022.md
Last active June 19, 2022 02:48
Hotspot not working after Windows Update June 2022

Hotspot not working after Windows Update June 2022

run unistall broken update

wusa /uninstall /kb:5014697

disable windows update

temporary until ms fixed it disable via group policy edit > "Computer Configuration" > "Administrative Templates" > "Windows Components" > "Windows Update" : "Disabled" in Configured Automatic Updates

reference

@abdulhadad
abdulhadad / zscaler_start.sh
Created March 1, 2022 08:06
macOS zscaler start stop
#!/bin/sh
# for admin user
if [[ "$EUID" != 0 ]]; then
sudo -k # next sudo, ask for password
if sudo true; then
echo "Password ok"
else
echo "Password error"
exit 1
fi
@abdulhadad
abdulhadad / homebrew-change-user.sh
Created October 18, 2021 17:04
Homebrew change user
sudo chown -R $(whoami) $(brew --prefix)/Caskroom/
sudo chown -R $(whoami) $(brew --prefix)/Cellar/
@abdulhadad
abdulhadad / eOMonth_test.js
Created May 19, 2021 12:18
eOMonth_test.js
const eOMonth = (date) => (new Date(date.getFullYear(),date.getMonth()+1,0))
const formattedDate = (date) => (date.getFullYear() + '-' + String(date.getMonth() + 1).padStart(2, '0') + '-' + String(date.getDate()).padStart(2, '0'))
/// test today, prev month
const today = new Date()
const prevMonthStartDate = new Date(today.getFullYear(),today.getMonth()-1,1)
const prevMonthEndDate = new Date(today.getFullYear(),today.getMonth(),0)
console.log(formattedDate(today))
console.log(formattedDate(prevMonthStartDate))
@abdulhadad
abdulhadad / .env
Last active June 25, 2020 06:40
Generate Excel JS headers
HEADER=Satu Dua,Dan Tiga,Empat Lima Enam
KEY=satu.dua,dan.tiga,empat.lima.enam
@abdulhadad
abdulhadad / diskpart.bat
Last active January 8, 2020 07:21 — forked from joeypiccola/diskpart.bat
Use diskpart to online, initialize, and format disks
diskpart
list disk
select disk 1
attributes disk clear readonly
online disk
select disk 1
clean
convert gpt
create partition primary
#format quick fs=ntfs label="data" unit=64k