Skip to content

Instantly share code, notes, and snippets.

View avipars's full-sized avatar
🎯
Focusing

Avi avipars

🎯
Focusing
View GitHub Profile
def remix(project_id, bearer_token):
url = f"https://api.lovable.dev/projects/{project_id}/remix"
payload = {
"include_history": "false",
}
headers = {
"Authorization": f"Bearer {bearer_token}",
"Content-Type": "application/json"
}
return requests.post(url, json=payload, headers=headers)
@avipars
avipars / auto_download.js
Last active March 5, 2025 00:11
Script to download all your Kindle books (run before before Feb 26, 2025)
// Updated by AmCan Tech: https://medium.com/avi-parshan-studios/you-will-no-longer-be-able-to-download-ebooks-from-amazon-c3a81deb6928
// 0. Optional - have chrome save all your downloads to a specific folder without asking you each time (via chrome settings)
// 1. Log in to your Amazon account
// 2. Go to your Content Library > Books - https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/
// 3. Go to page 1
// 4. Run the script in the dev console and wait a few seconds for it to start
(async function () {
// Close the notification if it appears
function closeNotification() {
const notifClose = document.querySelector("span#notification-close");
@avipars
avipars / script.js
Created February 21, 2025 10:03 — forked from spf13/script.js
Download all your Kindle books before Feb 26, 2025
// 1. Log in to your Amazon account
// 2. Go to your Content Library > Books - https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/
// 3. Open your browser's Javascript console
// 4. For each page of books, paste this script into the console
(async function () {
// Close the notification if it appears
function closeNotification() {
const notifClose = document.querySelector("span#notification-close");
if (notifClose) {
@avipars
avipars / vigenere_solver.py
Created January 8, 2025 20:06 — forked from akonradi/vigenere_solver.py
Python 3 script that solves English Vigenere ciphers by comparing the input against the letter frequency distribution of the English language
import itertools
import string
import sys
import textwrap
"""
Run this script in a shell with the ciphertext to decode on STDIN
"""
####################################################################################################
@avipars
avipars / recover.py
Created November 26, 2024 11:58
Recover ursl from great suspender
# script to ask user for the txt file name and then clean the URLS and save in new txt file
def main():
# ask user for the txt file name
file_name = input("Enter the txt file name: ")
parse_file(file_name)
def parse_file(file_name):
with open(file_name, "r") as file:
# read the file
@avipars
avipars / control.sh
Last active September 9, 2024 21:09
Pi Zero W LED Control
#!/bin/bash
# turn on LED
echo 1 | sudo tee /sys/class/leds/ACT/brightness
# turn off LED
echo 0 | sudo tee /sys/class/leds/ACT/brightness
# heatbeat blink
echo heartbeat | sudo tee /sys/class/leds/ACT/trigger
@avipars
avipars / audio_watermark_spectrogram.ipynb
Last active September 1, 2024 11:47
audio_watermark_spectrogram.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@avipars
avipars / watermarker.py
Created August 11, 2024 17:46
Watermark a PDF file (all pages)
import os
from PyPDF2 import PdfReader, PdfWriter
def main():
mark_it_up("watermark.pdf", "/source/", "/output/")
def mark_it_up(watermark_file, pdf_folder, output_folder):
"""
@avipars
avipars / cuts.pl
Created July 1, 2024 17:13
Prolog Backtracking and Cuts
% tail length
len([],A,A). %base
len([_|T],A,R) :-
A1 is A + 1,
len(T, A1, R).
% params to send
len(L,Res):- len(L,0, Res).
0
00
01
02
03
04
05
06
07
08