Skip to content

Instantly share code, notes, and snippets.

@me-suzy
me-suzy / gist:4b480ef9aee45635d79587892f9f7cdd
Last active July 26, 2022 20:26
How to make a Pop-Up/Prompt message on notepad++ (Plugins -> Python Script)
I've been wondering how to make a pop-up/prompt window in notepad ++, on the Python Script Plugin. I figured it out, so I'm writing here maybe someone needs it.
Basicaly, this is the prompt line:
`result = notepad.prompt('Number of modified files: ', '', number_files)`
The code below will make multiple search and replace on notepad++.
Two Pop-Up/Prompt windows will apear: first, when put the file path for replacing the files from a particular folder. And second pop-up/prompt window will be displayed after the replacement was made, with a message: "Number of modified files"
@me-suzy
me-suzy / gist:4ab83b97e85b29302746fbdc51a03427
Last active July 26, 2022 20:27
How to make a batch processor with multiple search and replace on notepad++ (you can also use regex for search and replace)
How to make a batch processor with multiple search and replace on notepad++.
This code works with Python Script Plugon on notepad++. Save this code as .py, and copy it in c:\Program Files\Notepad++\plugins\PythonScript\scripts\
Use Menu -> Plugins -> Python Script -> Scripts -> THIS-SCRIPT.py
Remember to change the path on the script, the location of folder where you want to change all files: Path="C:\\python-test"
-------------------------------------------------------------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
@me-suzy
me-suzy / merge.py
Last active September 26, 2022 08:32
Merging text files / How do I concatenate text files in Python?
import shutil
import os
import glob
filenames = glob.glob('*.txt')
with open('output_file.txt','wb') as wfd:
for f in filenames:
with open(f,'rb') as fd:
shutil.copyfileobj(fd, wfd)
@me-suzy
me-suzy / html; php;
Created November 18, 2022 09:48
JAVASCRIPT - READ MORE with link to website in java
<!------------READ MORE START-------->
<script type="text/javascript" >
function addLink() {
//Get the selected text and append the extra info
var selection = window.getSelection(),
pagelink = '<br /><br /> Read more at: ' + document.location.href,
copytext = selection + pagelink,
newdiv = document.createElement('div');
@me-suzy
me-suzy / .py
Last active April 19, 2023 07:14
Python error: ValueError: substring not found
So, I have this text that I must translated with library googletrans:
<!-- ARTICOL START -->
<p class="mb-40px">La muerte de Lorenzo el Magnífico puso fin al periodo.</p>
<p class="mb-40px">My name is print</p>
<p class="mb-40px">I must go home
<p class="mb-40px">I love my laptop when is clean</p>
<!-- ARTICOL FINAL -->
**The part of the python code with the problem is this:**
@me-suzy
me-suzy / html
Created June 21, 2023 10:51
Test Page
<!-- $item_id = 406; // Replace that with your rating id -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta Tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
[
{
"html_file": "https://neculaifantanaru.com/lideri-si-atitudine.html",
"line_count": 32
},
{
"html_file": "https://neculaifantanaru.com/leadership-magic.html",
"line_count": 33
},
{
@me-suzy
me-suzy / html
Created June 21, 2023 17:25
First html Template
<!-- $item_id = 5576; // Replace that with your rating id -->
<!DOCTYPE html>
<!--<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"><head>-->
<html lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<title>You Are Me And I Am You (I) | Neculai Fantanaru (en)</title>
<link rel="icon" href="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" sizes="192x192" />
<link rel="apple-touch-icon-precomposed" href="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" />
<meta name="msapplication-TileImage" content="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" />
@me-suzy
me-suzy / html
Created June 21, 2023 17:29
New Template 2023
<!-- $item_id = 5576; // Replace that with your rating id -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta Tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<title>You Are Me And I Am You (I) | Neculai Fantanaru (en)</title>
@me-suzy
me-suzy / gist:ed29d5240d26cbbb55ccb3ee59eb48b3
Created June 22, 2023 06:57
Python use Cpanel to send email by SMTP
**# Sending email with Cpanel by SMTP**
import sys
import smtplib
from_addr = 'YOUR EMAIL ADRESS'
to_addrs = ['YOUR EMAIL ADRESS']
msg = """From: Sender
To: Recipient
Subject: Okazii