Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
8
votes3
answers899
viewsA: Best syntax for PHP function names
There is no correct syntax, this goes to the taste of each one, what I will quote you are the differences camelCase In camelCase there may be variations of the use of uppercase and minuscule…
-
3
votes5
answers434
viewsA: Meta Author does not embed when sharing on Facebook
The problem is that the Facebook code was injected before the doctype: <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if…
wordpressanswered Guilherme Nascimento 98,651 -
1
votes1
answer2025
viewsA: "network failure" when downloading PDF generated with PHP’s FPDF class in Google Chrome
I believe the problem is with the cache You can do prevent caching, add this to the top: The I in the method Output already adds the header application/pdf and sends the buffer directly to the…
-
2
votes1
answer354
viewsA: Use cmd commands in shell scripts - cakephp 3.0
I don’t quite understand the doubt, I suppose you want to create a shell in cakephp, such as: namespace App\Shell; use Cake\Console\Shell; class HelloShell extends Shell { public function main() {…
-
14
votes2
answers22304
viewsA: How to hide command output in CMD?
There are 3 things to be done: @echo off Hides the commands typed by the user, apart from this it also hides the current folder that is browsing via command. Note that the @ serves to hide command…
cmdanswered Guilherme Nascimento 98,651 -
8
votes1
answer293
viewsA: How do I prevent caching Ajax requests in IE 6?
This cache problem even occurred in Internet Explorer more modern (when using Activex) and sometimes occurs in other situations, varying as the result of the back-end. The practical solutions are:…
-
5
votes4
answers354
viewsQ: How to put Nextel mask in an <input> with Javascript?
I’d like to put a mask on a <input> waiting for the format Nextel: <input type="text" name="nextel"> The problem that according to the website the format of Nextel is this: Urban: 2…
-
4
votes1
answer185
viewsQ: Bug textarea with padding in Firefox
The padding-bottom in a <textarea>, works normally on Google Chrome and in other browsers when scrolling the scrollbar, but in Firefox the spacing is always "fixed" and the texts appear cut.…
-
1
votes1
answer55
viewsA: Move links to list menu when mediascreen size is changed
From what I understood the only thing that is missing is to apply the media-query, in this case you can use a basic Meria-query only for width, however you need to choose the "maximum width" to…
-
3
votes2
answers176
viewsA: Manipulating Javascript window.history
With normal browsing not, however it is possible to "create/manipulate" the Urls using, the navigation in this case would be by ajax: var estadoDoObj = { foo: "bar" }; //Estado "atual"…
javascriptanswered Guilherme Nascimento 98,651 -
4
votes1
answer7472
viewsA: Share content
It seems to me these " are wrong, I do not know which framework is the one that used: <a data-action='share/whatsapp/share' href='"whatsapp://send?text=" +…
-
2
votes2
answers60
viewsA: How to add "www." to a website with web.config?
Following the logic of this other answer I made Remove "www" from domain by forwarding 301, the difference is that you have to "change" the action type="Redirect" for add input:…
-
4
votes2
answers217
viewsA: How to capture the status (and readyState) of the IE6 XHR?
I’m not sure, but I suppose the problem is that due to "Ajax" in Internet Explorer 6, 7 and 8 (these last two if used in quirks-mode) use Activex and not XMLHttpRequest properly said it must make…
-
2
votes1
answer572
viewsA: Picking with preg_match e-mail with special PHP characters
Just add _ in regex, another detail is that when using hype inside [] do the "escape", also recommend adding [0-9] (or d) because some emails have numbers, would be like this: If you want to have…
-
6
votes1
answer1360
viewsA: Change display property of a <div> by clicking on an <input>
Your question has become too vague, I’m not sure if the input points to a specific div, whether you will have multiple inputs and multiple Ivs. Yet the answer would be something like: You can use…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer1841
viewsA: How to send Push Notification to android and iphone with form processed by php?
PHP is back-end, or run on an HTTP server has nothing to do with android, it can never directly control the smartphone, or anything. You must first learn the difference of back-end and front-end,…
-
6
votes1
answer59
viewsQ: How to synchronize two scrollbars based on percentage?
I have a <DIV> overflow and a <TEXTAREA>, the problem is that the element that will be synchronized ends rolling over that the expected, instead of following the basis of the percentage.…
-
0
votes2
answers85
viewsA: My userscript does not work
You wrote the wrong function, missed relatives (): function repeat{ if (document.getElementsByClassName("agario-profile-name")[0].innerHTML == "Guest"){…
javascriptanswered Guilherme Nascimento 98,651 -
2
votes1
answer212
viewsA: Does anyone have an example of code using Marionette in Java for test automation?
I have no knowledge of Marionette, yet he is in disuse according to the link https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/firefox/MarionetteDriver.html The link itself…
-
2
votes1
answer4148
viewsA: How to put mascara in Wordpress contact-form-7?
In the form add the (class:telefone-mascara) [tel* seu-telefone class:telefone-mascara placeholder "seu telefone ou whatsapp"] In the plugin click edit: A textarea will appear with the following…
-
2
votes2
answers337
viewsA: Data entry without echoing on screen
A very simple way to do this is to put to record in os.devnull, so it will be possible to use input: import sys, os #Salva o output output_salvo = sys.stdout # Define o ouput pra gravar no devnull f…
-
1
votes1
answer31
viewsA: Update of Random Divs
A simple use of an IF can solve Note I think the use of setInterval so it can conflict, maybe it’s better to use setTimeout, to know the difference between the two recommend you see the following…
-
0
votes1
answer288
viewsA: How to solve Google Cache problem?
If the links are yours then you can try to configure using .htaccess (use apache) as I answered in /a/120344/3635 If it’s a github.io page, there’s no way (/a/67190/3635) If they are external links,…
-
5
votes1
answer399
viewsA: Is there any way to define a max-height of an element equal to the window size, with pure CSS?
With position: relative; and position: absolute; You can just use one positition: absolute in the .sidebar and positition: relative in the parent object (name of .main), note that html and body need…
-
1
votes1
answer171
viewsA: How do I get my images to fill any canvas in css
As I mentioned before /a/144303/3635 you can use display: flex and if you need to run in old browsers use display: table html, body { margin:0; padding:0; height: 100%; } .container { height: 100%;…
cssanswered Guilherme Nascimento 98,651 -
1
votes1
answer96
viewsA: Handle web page errors with PHP
If you are using apache you can create a . htaccess file at the root with this content: ErrorDocument 404 /home/user/public_html/enviar_erro.php Assuming your "root" folder is public_html The file…
-
0
votes2
answers3239
viewsA: Decrease the size of a file(image) in PHP
It is possible to manipulate the image on the client side and reduce it before sending to the server, you use Javascript with File API + Canvas API (HTML5) and Ajax (Ajax is opitional, you can save…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer820
viewsA: Is there a difference in performance between ng-bind and {{ }} (Interpolation)?
As stated in Soen, yes, there is difference, I do not know if it is significant in the final result or if it is noticeable, but use the "Brackets" ({{}}) is yes slower. The ng-bind is a directive…
angularjsanswered Guilherme Nascimento 98,651 -
2
votes6
answers3210
viewsA: How to remove this black border in this presentation by iframe?
This is because the page used in iframe fits the size based on a measure approximated to 4:3 ~ 16:9 (based on monite), when it opens directly, the browser will use the approximate screen medias and…
-
7
votes1
answer768
viewsQ: How do I get the message/details with addeventlistener("error")?
When I define true in the parameter useCapture: addEventListener(type, listener[, useCapture]); I can catch any mistake, however I can’t get the details of error, see:…
-
11
votes2
answers5104
viewsA: Good CSS practices for responsive Height. Is it armengue or not?
Look "there is no" this thing of good practice, there are better ways yes, but not every good practice meets everything. Now the only thing I say you should avoid is making entire layout based on…
-
5
votes4
answers209
viewsA: How to capture textarea tag with new line?
The other answers are the right ones and excellent ones, I just made some modifications: I modified the example of @Sergio for: /(<textarea[\s\S]+?<\/textarea>)/g Testing:…
regexanswered Guilherme Nascimento 98,651 -
13
votes1
answer2166
viewsA: Why do native angular directives start with NG?
According to this answer What does the ng stand for in Angular.js Directives and the first question of FAQ angular: https://docs.angularjs.org/misc/faq Why is this project called "Angularjs"? Why is…
angularjsanswered Guilherme Nascimento 98,651 -
14
votes1
answer5857
viewsQ: What is the difference between /bin/bash and /usr/bin/env bash?
I have not much knowledge of shell script, always used /bin/bash, but I noticed other variations: #!/usr/bin/env bash #!/usr/bin/bash #!/bin/bash What’s the difference between them? As far as I read…
-
5
votes2
answers3166
viewsQ: How to get the current path of a . sh script?
On Linux-based systems whenever I need to use the following command: #!/bin/bash BASEDIR=$(dirname "$0") echo $BASEDIR But I read in different places that $(dirname "$0") not supported by Mac OS X…
-
0
votes1
answer301
viewsA: Navbar effect similar to Twitter
So that the embroidery does not affect the other elements you can make use of the box-sizing: border-box; if using a fixed height and you want the animated effect (which are usually in the profiles)…
-
7
votes1
answer566
viewsA: Combination of languages that have a better performance for Web
Combination has nothing to do with it. In fact, programming languages have nothing to do with performance in a meaningful way, because what influences is how you use them, that is, how you program,…
web-applicationanswered Guilherme Nascimento 98,651 -
8
votes1
answer2619
viewsA: Skip to the next business day if the date falls on a weekend
As I say sometimes, some PHP functions are "speakers" (in PHP this is called relative formats), in case there is the instruction called weekday, representing days of the week (or as we call it in…
-
6
votes1
answer367
viewsA: Creating a Page Similar to Jsfiddle Site
I recommend first creating a iframe using the attribute sandbox, this to "try" to bring some security, preferably what you can do in HTML do, keep creating dynamic things with JS works well, but it…
-
9
votes2
answers455
viewsA: Font Responsiva
Samir’s answer is fine, but the measure vm is not supported by some older phones: Androids older than 4.4 (such as 4.2 and 4.3) iOS7, IE11 and Edge only have partial support (Source:…
-
5
votes1
answer113
viewsA: Block scrolling by screens
I suppose you’re talking about any element except textarea, inputs and selects, if so you can use regex or ifs to check the element combined with event.target: /^(textarea|input|select)$/i…
-
4
votes1
answer127
viewsQ: Is it possible to develop pro Safari extensions using Windows or Linux?
I remember that there used to be a Safari for Windows, which no longer receives updates, however even with it was necessary to have an Apple developer license, at the time it was free to develop pro…
-
2
votes1
answer57
viewsA: How to document parameters received by the "func_get_args" function?
According to the answer in Soen The old way would be: http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.param.pkg.html /** * @param int $param,... **/ However this is no…
-
4
votes2
answers302
viewsA: How can I protect myself from proxy servers?
There is no way to defend yourself efficiently and VPN is impossible (as far as I understand), the only way would be to have a list of Ips that is provided by some service, however this is not quite…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer328
viewsQ: App restarts when it changes orientation (rotated)?
I made this in my app: onCreate: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ... instances: @Override protected void onSaveInstanceState(Bundle…
-
3
votes1
answer502
viewsQ: How to generate an APK without DEBUG in Intellij IDEA?
I just migrated my projects from Eclipse to Intellij IDEA (is the same as Androidstudio uses, but with some small differences). Yet every time I click Build > Build Apk it generates an APK with…
-
3
votes1
answer520
viewsA: Time difference in execution of the same query between PHP and PHPMYADMIN
This performance test is PHP and not query, so it will give different results always, to debug a query you can use the set profiling=1; mysql> set profiling=1; mysql> EXPLAIN SELECT ...…
-
6
votes2
answers1190
viewsA: Swap Hidden field to text with javascript
The function document.getElementsByTagName is not used to search for attributes, I recommend you read the documentation, the use is totally wrong, this function searches by tag name, if you want to…
-
6
votes3
answers11617
viewsA: Problems with special characters Html5 bootstrap
The problem will not be solved by removing the metatags or exchanging accents for entities like ç, in the latter case it is only a way to bypass, but not to solve. The problem is how the…
-
2
votes1
answer83
viewsA: Disable Composer require with php
The Poser-autoloader uses the spl_autoload_register, the classes that are in the "require": are only loaded if used new, or static calls Exemplo::teste(); run the includes, it works like this: If…