Skip to content

Instantly share code, notes, and snippets.

View nicholasadamou's full-sized avatar
🤓
Working hard to make the world better with software.

Nicholas Adamou nicholasadamou

🤓
Working hard to make the world better with software.
View GitHub Profile
@nicholasadamou
nicholasadamou / README.md
Last active February 21, 2025 12:32
📥 Download all your Kindle books before Feb 26, 2025! This script saves you hours by automating the process of downloading hundreds or even thousands of Kindle books from your Amazon Content Library. Instead of manually clicking through pages, opening menus, and selecting download options for each book, this script handles everything for you!

📚 Kindle Book Downloader (Tampermonkey Script)

JavaScript

Automate Kindle Book Downloads Before Feb 26, 2025!

If you have hundreds or even thousands of Kindle books, manually downloading them is frustrating and time-consuming. This script automates the process, saving you hours by handling downloads with just one click. 🚀

📝 Features

Automatically selects and downloads all your Kindle books via Amazon's "Download & Transfer via USB" option.

@nicholasadamou
nicholasadamou / pin_lock_version.js
Last active October 1, 2024 20:06
This script, version-pin-and-clean.js, automates the process of pinning and cleaning dependency versions in a package.json file. It reads version information from a pnpm-lock.yaml file and updates both dependencies and devDependencies in package.json to match the versions specified in the lock file, removing any leading version specifiers like ^…
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
console.log('Starting the version pinning and cleaning process...');
// Utility function to determine which package manager is used
const determinePackageManager = () => {
if (fs.existsSync(path.join(__dirname, 'pnpm-lock.yaml'))) {
return 'pnpm';
@nicholasadamou
nicholasadamou / pnpm-node-matcher.py
Last active October 1, 2024 20:19
A utility script that determines the appropriate pnpm version based on the Node.js version used in your project. It reads from .nvmrc, package.json, or defaults to the currently installed Node.js version, ensuring compatibility and simplifying dependency management. Optionally, it can also install the recommended pnpm version automatically.
import os
import json
import subprocess
import requests
# Compatibility table for pnpm versions based on Node.js versions (only the major versions)
pnpm_compatibility = {
'14': '6', # PNPM 6 for Node 14
'16': '7', # PNPM 7 for Node 16
'18': '8', # PNPM 8 for Node 18
@nicholasadamou
nicholasadamou / index.js
Created September 18, 2022 01:39
Convert HTML to HTML Entities
const toHTMLEntities = (html) => {
let result = '';
for (let i = 0; i < html.length; i++) {
result += "&#x" + html[i].charCodeAt(0).toString(16) + ";";
}
return result;
}
@nicholasadamou
nicholasadamou / scan.sh
Created September 2, 2019 11:56
Scan for nearby networks every 10 seconds on MacOS
#!/bin/bash
while true
do
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
sleep 10
done
# Increase history
$MaximumHistoryCount = 10000
# Produce UTF-8 by default
$PSDefaultParameterValues["Out-File:Encoding"]="utf8"
# Show selection menu for tab
Set-PSReadlineKeyHandler -Chord Tab -Function MenuComplete
# Helper Functions
@nicholasadamou
nicholasadamou / boxstarter
Last active February 16, 2019 12:45
Base Windows Configuration
### Base Windows Configuration ###
<#
The command to run, built from the raw link of this gist
Win+R
iexplore http://boxstarter.org/package/url?<RAW GIST LINK>
OR (if you don't like the way the web launcher force re-installs everything)
Create another script like the following to install and run the gist:
@nicholasadamou
nicholasadamou / install.sh
Last active January 26, 2019 15:15
Install a DMG file via CLI.
#!/bin/bash
# see: https://apple.stackexchange.com/a/311511/291269
function install_dmg {
set -x
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Initialize a variable for the URL to the '.dmg'
@nicholasadamou
nicholasadamou / setup.sh
Last active December 14, 2018 02:06
Reset Parallels Desktop's trial and generate a casual email address to register a new user.
#!/bin/sh
# Reset Parallels Desktop's trial and generate a casual email address to register a new user
sudo rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml
jot -w pdu%[email protected] -r 1
@nicholasadamou
nicholasadamou / add-apt-repository
Last active August 21, 2018 16:33
Utility to add PPA repositories in your debian machine.
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
else