Posts by h3nr1ke • 845 points
50 posts
-
1
votes2
answers1407
viewsA: How to return all objects of a JSON array
Hello, what you’re looking for is Object.Keys, it returns an array with the property of an object passed as parameter. let nomes = [ { "nome": "JOSE" }, { "nome": "MARIA" }, { "nome": "SERGIO" } ];…
-
0
votes3
answers1235
viewsA: How to get the element id
To interact with the event-enabled element only vc can $(document).on('touchstart', '.elemento', function (){ // adiciona uma class active apenas no elemento o selecionado…
-
3
votes1
answer154
viewsA: What does this command mean in git " "?
Imagine that you wanted to see the difference of your current directory with the "parent" commit, you use the ^ for example: git show <branch>^ Displays the differences between your copy and…
-
0
votes1
answer49
viewsA: Doubt of Linux Crontab
According to this link and tested in Ubuntu The command does nothing, however, if you finish with Ctrl+D it erases the current cron file if you close with Ctrl+C it ends and nothing happens.…
-
1
votes1
answer1011
viewsA: PHP concatenate string + variable with obj->method
You can assemble the method name using the concept of variable functions <?php //classe para de teste com get e set class teste{ private $nome = ""; public function getNome(){ return…
-
0
votes1
answer63
viewsA: Add Wordpress Filter
The function you seek is the add_screen_option to add the option you can do function add_screen_option(){ $option = 'per_page'; $args = array( 'label' => 'Movies', 'default' => 10, 'option'…
-
1
votes2
answers614
viewsA: Identify origin of php code
All themes follow (or should follow) the convention of Wordpress itself, described in this link for example, if the page you are viewing is a post, it is very likely to be in the file single.php, if…
-
0
votes1
answer998
viewsA: Can someone explain this part to me in JSON please?? (Wordpress Plugin)
This field you edited is not for HTML, it is the initial config of Datatable, included in the code using CDN, as per code in the respository for customization, the plugin offers the possibility to…
-
3
votes1
answer203
viewsA: How to customize only one post type to appear on the single.php
According to the documentation here, you can create a new single with the name inside the current theme. single-<post-type>.php if the post type is used single-emprego.php For a change from…
-
0
votes0
answers73
viewsQ: GRUNT CSS-MIN does not process with @import inline
Hello, I am building an html page where I merge js files using Grunt and the modules Grunt-usemin Grunt-contrib-uglify Grunt-contrib-Concat to compress the js using the following structure <!--…
-
1
votes2
answers402
viewsA: PHP - array shuffle
Instead of printing directly, save each one in an array. $itens[] = "<div><label>Postado por <b>$userPost</b> - $post</label></div>"; then use one of the…
-
2
votes1
answer708
viewsA: Start a virtualenv with file . bat
To run another . bat inside your file, you need to call it using call activate.bat assuming they’re in the same folder if no call is used it interrupts the current process to run the new.…
-
0
votes2
answers507
viewsA: List taxonomy Terms related to specific post_type Wordpress
I believe you need to do the consul for tax_query $posts = get_posts( array( 'posts_per_page' => -1, 'post_type' => 'graduacao', 'tax_query' => array( array( 'taxonomy' =>…
-
1
votes1
answer636
viewsA: Problem to get the text attribute of a Select2
Based on this reply you can pick up any property of the item using var data = $('your-original-element').select2('data'); if(data) { console.log(data.text); } only one detail regarding the version…
-
0
votes1
answer230
viewsA: Select2 database
After changing the angular value, trigger the event change.select2 of Select2 itself $('#paisPais').trigger('change.select2'); so the value will be updated in the whole structure of the element,…
-
0
votes1
answer73
viewsA: What are the variables for the Cordova geolocation plugin in iOS?
The variables for the other iOS geolocation options are <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="Mensagem de uso" /> <variable…
-
0
votes1
answer76
views -
1
votes2
answers794
viewsA: Treat JSON by Javascript
I guess something like that var response = '[{"1":"4"},{"2":"3"},{"3":"7"}]'; var parsed = JSON.parse(response); var arr = []; parsed.forEach(function(pvalue,index,ar){ for(var pname in pvalue){…
javascriptanswered h3nr1ke 845 -
0
votes1
answer73
viewsQ: What are the variables for the Cordova geolocation plugin in iOS?
During the creation of a plugin for Cordova that uses geolocation, it is necessary to add a variable to "Privacy - Location Usage Description" which is the GEOLOCATION_USAGE_DESCRIPTION. in the…
-
2
votes2
answers1262
viewsQ: How to run mysql database using shell script if the base name has "-"
On the server there are some databases with the name modelo-submodelo (this is the name of the database, created with "-" same). When I execute a command like: mysqldump -h"$DBHOST" -u"$DBUSER"…
-
0
votes1
answer57
viewsA: I cannot create zip in Debian
I made a small adjustments to get the directory and it worked normally your code, unless your variable is empty or with a wrong path that is saving the file in a different folder than the one you…
-
2
votes3
answers3141
viewsA: How to monitor a file in real time on Windows?
If you want to continue using the tail you can install Mingw https://sourceforge.net/projects/mingw-w64/ with it you can execute the command itself. C:\>tail -f log.txt…
-
-2
votes1
answer510
viewsQ: How to upload a file using lftp?
How can I send a file from my local machine to the remote server using lftp?
-
0
votes1
answer510
viewsA: How to upload a file using lftp?
To send a file to the remote server, first run the lftp lftp the prompt of lftp will open lftp :~> now it is possible to connect to the remote server lftp :~> open -u "usuario","senha" host;…
-
3
votes2
answers1773
viewsQ: How to make code include in Shell Script files
How can I perform the following process: Add the arquivoa.sh and arquivob.sh in the arquivoc.sh, and then perform the defined functions within each file archivoa.sh #!/bin/bash echo "Arquivo A"…
-
7
votes2
answers1773
viewsA: How to make code include in Shell Script files
To add a script within another and be able to make use of the functions it is necessary to add the following line at the beginning of the file source <arquivo_alvo> and to perform the function…
-
0
votes1
answer130
viewsA: jQuery plugin change attributes with $.extend
If I understand correctly, you want to use the options inside the plugin. To illustrate I changed your code and includes the functionality of adding a new class in the element (function( $ ){…
-
0
votes2
answers261
viewsA: PHP multidimensional array union
Apparently the function array_merge_recursive should do the job. However, when indexes are not defined or are numbers, the function does not work. On the page of array_merge_recursive there is a…
-
1
votes1
answer71
views -
0
votes1
answer71
views -
0
votes2
answers1031
viewsA: Pass external variable or Constant into a Function
according to the documentation in this link, there are some ways to do <?php $a = 1; /* escopo global */ function Teste() { echo $a; /* referencia uma variável do escopo local (não definida) */ }…
-
4
votes3
answers1605
viewsA: Can you access the bash on Android?
Hello, yes is possible using the adb see the here more information about him. In short, adb shell opens the prompt and you can run the commands, but remember that they are restricted.…
-
0
votes0
answers285
viewsQ: How to enable Woocommerce Sidebar?
I own a site in Wordpress 4.1.15 and use Woocommerce as the virtual store. One of the users deleted the pages of Checkout and Shop and when I saw I returned the pages of the recycle bin but after…
-
1
votes1
answer160
viewsA: Event from the choice of jquery radio option
Hello, 1 - I added two classes to the control <div role="tabpanel" class="tab-pane active" id="tab_contabeis"> <br/> <div class="radio"> <label> <input type="radio"…
-
0
votes4
answers13879
viewsA: How to detect if an HTML element is empty?
You can use jQuery(document).ready(function () { //esta é uma alternativa mas pode falhar quando existem espaços em branco dentro da tag var test = jQuery("#elemento").html(); if (test.length <=…
-
2
votes1
answer89
viewsA: Add One More Field to Inline Calculator
Just use the code var selectMark = parseFloat(document.getElementById("mark").value); to take the value of the new select, and then use it to perform the split. the example code link you passed, is…
javascriptanswered h3nr1ke 845 -
3
votes1
answer780
viewsA: Validate captcha with PHP
Hello, can yes, capture the input value using // pode ser feito assim... $captchaEnviado = $_POST['captcha']; //ou assim... que é mais seguro... $captchaEnviado = filter_input(INPUT_POST, 'captcha',…
-
1
votes3
answers182
viewsA: Drupal, put the Web Form on top of the content.
It is necessary to change the some files in the theme you are using. 1 - Create a new region for the content you want, this is done in the file seutema.info regions[conteudoantes] = 'Itens exibidos…
-
2
votes1
answer1756
viewsA: State Combobox - PHP city
In your file of scripts jQuery, add a function to take care of the event change jQuery("#estado").on('change',function(){ var estadoSelecionado = jQuery( this ).val(); //e aqui vc executa o restante…
-
3
votes2
answers1186
viewsA: How to remove the shading (backdrop) of a modal in Bootstrap and free the remaining area of the page?
to remove the fade behind the modal .modal-backdrop.in{ display: none; } to enable page overflow again .modal-open{ overflow: visible; } to unbox the modal click, include in the modal opening call…
twitter-bootstrapanswered h3nr1ke 845 -
2
votes4
answers4978
viewsA: Validating Date of birth
a solution counting the milliseconds //define as duas datas base... var actualDate = new Date(); //validando 25/09/2000 que ainda nao completou 15 anos var birthDate = new Date("2000", "8", "25",…
-
0
votes2
answers846
viewsA: Duplicate values in php
Assuming the scenario tabela - brinquedos colunas id nome quantidade_doada quantidade_disponivel and that internal data are id nome quantidade_doada quantidade_disponível 1 bola 10 9 2 bola 6 6 3…
-
0
votes1
answer563
viewsA: How to clear the query string after I already got the values I want?
Hello, use following Javascript code //pega a url atual, remove o query string e altera a url var pageObj = {"html":"","pageTitle":""}; window.history.pushState(pageObj ,"",…
-
1
votes1
answer196
viewsA: Javascript x Ajax x html x jquery
Try the following Include a touch/click action on the Ubmit button, perform this at the time of "deviceready" //exemplo jQuery("#id_do_submit").on("click",function(e){ e.preventDefault(); //para…
-
0
votes2
answers107
viewsA: Authenticate PHP page through the application is not working
Hello, I believe you have to modify the line that makes the query (if you haven’t already, and this is just an example) of $sql = "select * from usuarios where username='1' and password='1'"; for…
-
1
votes1
answer394
viewsA: window.open() does not load the page
Hello, as mentioned by our friend @Hatchet-Knife, it is necessary to include 'http:// ou https://' in the URL, in your case on the date. to test, you can: //verificar se existe http ou https var…
-
1
votes1
answer366
views -
0
votes1
answer73
viewsA: Fade Radial js or canvas
Hello, made an example (actually updated your example) Code with example animation ... where I used pure CSS animation. It is necessary to set the positions and delays to achieve a better effect. It…
-
2
votes4
answers1135
viewsA: Javascript error in Wordpress admin after upgrade to version 3.8
Looking a little more found in Stackoverflow in English a alternative that worked. In the end it was necessary to change php.ini and disable the following configuration variables: magic_quotes_gpc…
-
5
votes4
answers1135
viewsQ: Javascript error in Wordpress admin after upgrade to version 3.8
I recently updated an installation of Wordpress 3.0 for 3.8 and the features of drag and drop stopped working. I noticed two Javascript errors on the page in the file load-scripts.php indicating a…