Skip to content

Instantly share code, notes, and snippets.

View abdulhadad's full-sized avatar

Abdul Hadad abdulhadad

View GitHub Profile
@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
@abdulhadad
abdulhadad / promise_async.md
Created December 17, 2019 03:27
promise_async.md
```js
var asyncRequest = new Promise(function(resolve, reject) {
        return setTimeout(function(){
            resolve({body: {
                a: process.env.AUTH_URL,
                b: process.env.AUTH_HEADERSKEY,
                c: process.env.AAUTH_HEADERSVAL,
                d: obj
            }})

}, 3000);

@abdulhadad
abdulhadad / launch.json
Created December 13, 2019 08:03
VS Code start with env and test with debug
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",