- Nightwatch: 1.0.18.
- Selenium standalone: 3.141.59.
- Chromedriver: 2.46.
- Install chromedriver:
# Inside project
npm install chromedriver --save-dev
const truncateString = (str, num) => | |
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str; | |
truncateString('boomerang', 7); // 'boom...' |
# Functions | |
# | |
# System functions | |
# | |
find_kill_process() { | |
# This function shows the process list and search on it | |
# Requires fzf available | |
pid=$(ps -ef | sed 1d | eval "fzf $FZF_DEFAULT_OPTS -m --header='[kill:process]'" | awk '{print $2}') | |
if [ ! -z "$pid" ] | |
then |
/** | |
* ValidateSpanishID. Returns the type of document and checks its validity. | |
* | |
* Usage: | |
* ValidateSpanishID( str ); | |
* | |
* > ValidateSpanishID( '12345678Z' ); | |
* // { type: 'dni', valid: true } | |
* | |
* > ValidateSpanishID( 'B83375575' ); |
.tree-element { | |
margin: 0; | |
position: relative; | |
} | |
div.tree-element:before { | |
content: ''; | |
position: absolute; | |
top: 24px; | |
left: 1px; |
from copy import deepcopy | |
def min_n(lst, n=1): | |
numbers = deepcopy(lst) | |
numbers.sort() | |
return numbers[:n] |
function arrify(val) { | |
return val == null ? [] : Array.isArray(val) ? val : [val]; | |
} |
function addParams(url = "", params = {}) { | |
// Inicializamos la URL | |
let myUrl = new URL(url); | |
// Obtenemos todas las keys de los parametros que nos vienen del objeto, en el ejemplo "foo" y "eggs" | |
// Usamos el foreach para recorrer cada key y extraer su valor con params[key] | |
// Con searchParams.append agregamos los parametro que queremos | |
Object.keys(params).forEach(key => openStreetMapReverseGeocodeUrl.searchParams.append(key, params[key])); | |
// Retornamos la url | |
return myUrl; | |
} |
nmap -p 22 192.164.1.0/8 | |
# -p: el puerto a buscar, en este caso ssh, el 22 | |
# rango de ip a buscar: el /8 son toda las ip todas las ips del cero final |