Sometimes we try to do http requests from Electron to any page and it seems to be blocked by the "Browser engine" that comes with the renderer proccess.
There's one solution
- Change the BrowserWindow security config
// For searching into an array, by object property | |
let arr = [ | |
{ name:"string 1", value:"this", other: "that" }, | |
{ name:"string 2", value:"this", other: "that" } | |
]; | |
let obj = arr.find(o => o.name === 'string 1'); |
## Este archivo crecerá | |
# Para "disk usage". Devuelve el espacio en disco que ocupa un archivo o carpeta | |
du | |
# Put in there knowledge for conditionals, if/else, find, pipes |
# If you don't set "_usuario" and "_pass" for DB, this script won't work | |
# constants setted | |
_usuario="" | |
_pass="" | |
_input="images.txt" | |
_search_in="../Evidencia" | |
_carpeta_puente="__ejemplo" | |
_carpeta_salida="../storage/images" | |
_limit="LIMIT 5" |
import datetime | |
begin = datetime.datetime.now() | |
# Code we want to measure goes here | |
end = datetime.datetime.now() | |
time = end - begin | |
print("\n" * 5, time.seconds , "\n" * 5) |
Git hooks live into .git/hooks folder in every git repo.
The name of each one tells us when the git hook it's gonna be executed, and the .sample extension in each one prevent its execution.
When we are going to execute a script in some part of git's lifecycle, we need to
from importlib import import_module | |
my_module_new_name = import_module('variable.module.name') |
## Remember that the options below could be used together | |
# List all the changes made in a file | |
git log <path_to_folder_or_file> | |
# Track the change history of a file (including rename) | |
git log --follow <file> | |
# list commits by author | |
git log --author="example_user" |
<?php | |
// print_if_not_failed sólo afecta si la operación fué exitosa | |
function json_check_print($mensaje_posible_error = 'error', $variable = null, $print_if_not_failed = false, $json = false){ | |
$print = [ | |
'error' => null | |
]; | |
if($json) | |
header('Content-Type: application/json'); | |
$failed = $variable === null || $variable === false; | |
if($failed) |
function getURLParameter(name) { | |
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null; | |
} | |
function changeUrlParameter(url, parametro, value){ | |
let separator = '&' | |
if(url.indexOf("?") === -1) | |
separator = '?' | |
url = window.location.href + '&' |