Skip to content

Instantly share code, notes, and snippets.

View weaponsforge's full-sized avatar
🌴
On vacation

Weapons Forge weaponsforge

🌴
On vacation
View GitHub Profile
@weaponsforge
weaponsforge / starcounter.js
Created October 21, 2024 18:46 — forked from yyx990803/starcounter.js
Count your total stars!
var https = require('https'),
user = process.argv[2],
opts = parseOpts(process.argv.slice(3))
request('/users/' + user, function (res) {
if (!res.public_repos) {
console.log(res.message)
return
}
var pages = Math.ceil(res.public_repos / 100),
@weaponsforge
weaponsforge / debugging_with_vscode.md
Last active October 18, 2024 15:03
Debugging with VSCode

Debugging with VSCode

These notes are compatible with VSCode/Cursor having the following specs. Steps for other versions may vary.

Version: 0.42.3
VSCode Version: 1.93.1
Commit: 949de58bd3d85d530972cac2dffc4feb9eee1e40
Date: 2024-10-16T17:56:07.754Z
Electron: 30.4.0
@weaponsforge
weaponsforge / version.sh
Created August 29, 2024 16:36
NodeJS Package Version
#!/bin/bash
# Prints the version of a nodejs package.json file
VERSION=`node -e "console.log(require('../app/package.json').version)"`
echo Synchronizing all modules to version $VERSION
@weaponsforge
weaponsforge / libraries-frameworks.md
Last active December 23, 2023 14:26
Interesting Libraries and Frameworks

Websockets

  • List of tools for playing with Websockets [link]

TotalJS Platform

  • unique JavaScript solution targeted at creating rich real-time web applications
  • has an intuitive (nocode-like) drag and drop UI
  • Website [link]
  • GitHub [link]
@weaponsforge
weaponsforge / react-optimization.md
Last active November 21, 2023 03:12
React Optimization Techniques

React Optimizations

A list of interesting React optimization techniques.

[1] Do less work during rendering

@weaponsforge
weaponsforge / delete_git_tags.sh
Last active May 30, 2023 11:04
Delete all remote and local git tags
# Delete all remote tags
git tag | xargs -L 1 | xargs git push origin --delete
# Delete all local tags
git tag | xargs -L 1 | xargs git tag --delete
@weaponsforge
weaponsforge / compact.bat
Last active March 10, 2023 06:27
Compact/compress the size of an Ubuntu VDI file on VirtualBox running in a Windows host
:: Compact/compress the size of an Ubuntu VDI file on VirtualBox (v7.0) running in a Windows host
:: The VDI file should should have previously run "compact.sh" in the VM before running this script
:: Add VBoxManage.exe to the PATH variable to make it globally available. Usually it's in
:: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
VBoxManage.exe modifymedium --compact c:\path\to\thedisk.vdi
@weaponsforge
weaponsforge / compact.sh
Last active March 10, 2023 06:29
Compact/compress the size of an Ubuntu VDI file on VirtualBox
# Compact/compress the size of an Ubuntu VDI file on VirtualBox (v7.0)
# Run this script in the Ubuntu VM running in VirtualBox
# Shut down the VM after then run "compact.bat" on the Windows host
df -h
echo "Nullifying free space..."
sudo dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k status=progress ; sudo rm -f /var/tmp/bigemptyfile
const string = 'Hello, World!'
// Split the a string into words while removing special characters
const words = string.replace(/[!@#$%^&*()_+\-=\[\]{};:"\\|,.<>\/?]/g, '').split(' ').filter(x => x.match(/[a-z]/g))
console.log(words)