This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def highlight(element): | |
"""Highlights (blinks) a Selenium Webdriver element""" | |
driver = element._parent | |
def apply_style(s): | |
driver.execute_script("arguments[0].setAttribute('style', arguments[1]);", | |
element, s) | |
original_style = element.get_attribute('style') | |
apply_style("background: yellow; border: 2px solid red;") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.JavascriptExecutor; | |
import org.openqa.selenium.WebDriver; | |
public class LocalStorage { | |
private JavascriptExecutor js; | |
public LocalStorage(WebDriver webDriver) { | |
this.js = (JavascriptExecutor) webDriver; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
# requires pycryptodome lib (pip install pycryptodome) | |
import sys | |
import base64 | |
import os | |
import json | |
from Crypto.Cipher import AES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove a single file | |
git rm --cached password.txt | |
# Remove a single folder | |
git rm --cached -rf .idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reverseVowels = function (s) { | |
const arr = s.split(""); | |
let left = 0, right = arr.length; | |
const vowels = ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u']; | |
while (left < right) { | |
if (vowels.indexOf(arr[left]) === -1) { | |
left++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reverseString = function(s) { | |
let left = 0; let right = s.length - 1; | |
while (left < right) { | |
let tmp = s[left]; | |
s[left++] = s[right]; | |
s[right--] = tmp; | |
} | |
return s; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To install Wordpress on a server | |
https://websiteforstudents.com/setup-apache2-virtualhost-multiple-wordpress-blogs/ | |
# To add new elements to the top menu bar | |
https://www.wpbeginner.com/beginners-guide/how-to-add-navigation-menu-in-wordpress-beginners-guide/ | |
# To add a contact form | |
https://www.wpbeginner.com/beginners-guide/how-to-create-a-contact-form-in-wordpress/ | |
# To setup the notifications and SMTP configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Landscaping With Frontend Development Tools | |
An opinionated list of tools for frontend (i.e. html, js, css) desktop/laptop (i.e. does not include tablet or phone yet) web development | |
##Coding Tools | |
######Workflow/Builds/Assemblers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Realizar backups de manera facil con rsync y ssh | |
Enviado por RazaMetaL el Mié, 2007-02-14 14:27. | |
Tengo dos servidores, uno tiene un eggdrop que guarda el log de actividad de un canal en /home/bot/logs/canal. Hasta ahi todo esta muy bien, pero requiero que esos logs se publiquen en un sitio web que se encuentra en otro servidor. | |
La manera mas sencilla y practica que encontre para hacer esta tarea fue usando rsync para sincronizar los archivos de log desde un servidor a otro y que solo se copien los archivos nuevos o modificados. | |
Primero vamos a decidir las opciones para rsync, en mi caso y como lo explico en el parrafo anterior requiero copiar todos los archivos al nuevo servidor, despues que copie solo los nuevos archivos y/o los modificados. Todo esto lo logro pasando las opciones -avz y -e ssh a rsync. | |
-a para copiar recursivamente manteniendo privilegios, fecha de creacion, permisos, etc.; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up Sendy with Laravel | |
(there might be bugs, I striped out some parts of my code because what I have is more complicated then that, so, sorry if it's broken!) | |
-- | |
I would recommand creating a database for Sendy only. | |
Add Sendy's database into your database.php (1) | |
Create the Campaign model (2), and specify that you want to use Sendy's database (Campaigns are the only thing we really need to create, other things like creating lists can be done through Sendy interface, and there is a PHP library to add subscribers) | |
Now, it's time to install Sendy, usually somewhere like yourapp.com/sendy or yourapp.com/newsletter |
NewerOlder