Posts by hernandev • 4,704 points
54 posts
-
0
votes3
answers644
viewsA: How to add a css class to an element according to the page accessed in Vue.js
<router-link tag="li" to="route-here"> <a>meu botão</a> </router-link> It will generate a li containing the with the link inside. if the internal a is active, the outside li…
-
1
votes2
answers499
viewsA: Api Restful Lockable 5.2
To get the initial token, you need to create a route outside the group that uses middleware auth.api a simple route as api/authenticate that receives the user data and returns the token, if the…
-
3
votes2
answers135
viewsQ: How to delay the Vuejs v-model?
So that the information is changed when the field focus is out, and not as you type.
-
4
votes2
answers135
viewsA: How to delay the Vuejs v-model?
The same can be obtained by the attribute lazy Example: <input v-model="msg" lazy>
-
1
votes2
answers273
views -
3
votes1
answer557
viewsA: Limit payment options to Paypal accounts only (credit card not)
Paypal does not allow such blocking, the only locks available are: Block US People payments with no confirmed email address Block payments in currencies other than your account Block accidental…
-
10
votes6
answers20131
viewsA: Difference between single and double quotes in PHP
Single quotes Recognise the content literally, everything will be treated as text: <?php $valor = 10; $variavel = 'meu número é $valor'; echo $variavel; // Saida: meu número é $valor Double…
-
1
votes2
answers923
viewsA: Ngnix problem on OS X Mavericks
Rotate the commands sudo mkdir -p /Users/username/code/product/log/ sudo touch /Users/username/code/product/log/nginx_access.log sudo chmod 777 /Users/username/code/product/log/nginx_access.log and…
-
3
votes1
answer231
viewsA: Error trying to install SASS/COMPASS
add sudo before the command that is running before: commando afterward sudo comando
-
1
votes4
answers594
viewsA: How to create a URL redirector?
You can do it like this: 1) If you want to obfuscate your link, use the function base64_encode base64_encode('http://google.com'); 2) if you need to pass the parameter to the script, for example…
-
0
votes3
answers731
viewsA: Problem with function call in Cakephp
Solution Failed to add App::uses('AppModel', 'Model'); At the beginning of Model, it would look like this: <?php App::uses('AppModel', 'Model'); class Passagem extends AppModel { public $name =…
-
1
votes4
answers1418
viewsA: How do I programmatically respond to a command on the Linux terminal?
Use the pExpect, that provides among other features, something that looks like the expect linux. See an example of how to interact with a session TELNET import pexpect import sys,time ipaddr =…
-
5
votes1
answer717
viewsQ: Capture errors and PHP Exceptions
Setting I know I can configure the logs so that the errors and exceptions are recorded, this is nice, but sometimes it is too boring to read these files. Question How to capture the mistakes and…
-
6
votes2
answers9606
viewsA: How to compile a PHP file?
Not, phar is not bytecode, understand what can be done based on need: Distribuição Facilitada phar It is actually a package containing the files, it is not actually compiled or bytecode, it was…
-
7
votes1
answer377
viewsA: How to put an HTML code on a label in Laravel?
You should use the HTML::Decode() method for this purpose, try as follows: {{ HTML::decode(Form::label("nomecampo", "Descrição<em>*</em>", array("class" => "entrada")) ) }};…
-
6
votes1
answer428
viewsA: Route error not defined in Orange 4
Route Names in Laravel 4 One of the biggest mistakes when you start using Laravel 4 is confusing the nome of the route with the url or padrão of the route, see an example:…
-
4
votes2
answers454
viewsA: Self-referential global object: what is it for and why does it exist?
self is set in the Javascript environment and points to the objeto global, but is not part of the specification of DOM, and may not be present in the browser. While window is part of the…
javascriptanswered hernandev 4,704 -
35
votes3
answers6498
viewsA: How to model a tree data structure using a relational database?
Well, it is always preferable to use a DBMS that handles data on tree in a natural way, even better when it is specially designed for such purpose, as for example, the Neo4j. But there are some ways…
-
15
votes1
answer1873
viewsQ: Mobile App Multiplatform with Xamarin
Setting This question is more about architecture. I recently started learning Xamarin to develop Mobile Apps, Xamarin, which until then has been very flexible, has bindings for native Android and…
-
4
votes1
answer1081
viewsA: URL::Previous() returns incomplete path
The method URL::previous() is based on HTTP Referer which is roughly an information your browser sends to the site being accessed in the request header (HTTP Headers), informing which URL the user…
-
12
votes3
answers1636
viewsA: How to create a conditional index in Mysql?
Mysql does not support conditional indices, however, the term índices parciais is generally found in the literature referring to the index of prefixo, which is a resource supported by Mysql, see the…
-
13
votes2
answers1282
viewsQ: Handle large files with GIT
Setting Some time ago, I tried to use GIT to restore some backups, mostly small files, git behaved very well by versioning them when the changes from one commit to another weren’t big, but on a…
-
21
votes2
answers4325
viewsA: Permission denied when moving file with move_upload_file on Linux server
Linux server permissions issues In the PHP world, there are several ways to "run" a website, in general most of them are using a web server known as Apache or Nginx, when manipulating files,…
-
11
votes3
answers2560
viewsA: Database redundancies are always undesirable?
Data redundancy is permissible in two cases: Performance It is common in a database designed for large loads to have some redundant data, so that some data are avoided JOIN's in SELECT's, see an…
-
9
votes1
answer494
viewsA: Read contacts contacts agenda iPhone using Xamarin
1 - Install an Abaddressbook. using(var addressBook = new ABAddressBook ()){ … } 2 - Call Getpeoplewithname, passing the name of the contact to search. This method returns an array of Abperson…
-
6
votes1
answer1692
viewsA: Email sending works locally but not on a remote server
Your provider is preventing SMTP on your server / hosting, open a support ticket and ask about the release. It is a common practice among hosting providers/servers to keep SMTP traffic blocked to…
-
1
votes1
answer74
viewsA: Conflicts with the Confideuser class
You should, according to the guidance of the package documentation, use the user class as follows: use Zizaco\Confide\ConfideUser; class User extends ConfideUser { // No seu caso, usando outra…
-
11
votes2
answers3208
views -
4
votes2
answers2962
viewsA: .htaccess with subfolder other than root
Case 1: Installing Laravel in a subfolder (Symbolic Link) Following its structure, all you need to do is create a symbolic link on www/folder/index.php pointing to www/folder/public/index.php. To do…
-
3
votes1
answer260
views -
4
votes1
answer517
viewsA: How to deal with multiple login areas in Laravel?
The most practical method is to configure the authentication on the route where needed: Config::set('auth.model', 'Admin'); or set to a URI standard if ($request->is('admin*')) {…
-
4
votes3
answers4784
viewsA: Why Laravel instead of Yii?
I don’t know Yii very well, just a glance or another in the code, but I will mention here the positive points that are usually decisive in choosing Laravel. Elegant syntax - Laravel’s syntax is…
-
8
votes2
answers952
viewsA: Authentication with two different tables
The most practical method is to configure the authentication on the route where needed: Config::set('auth.model', 'Admin'); or set to a URI standard if ($request->is('admin*')) {…
-
13
votes5
answers10782
viewsA: What is a Mysql Transaction for?
Mysql when using some more recent storage plugin (Innodb, Xtradb) has support for transações, basically, commit and rollback, but what are they for? When starting a transaction, you basically tell…
-
1
votes1
answer170
viewsA: Read files in a directory sorted by creation date
You won’t be able to make use of the function scandir() directly, but in this way: $arquivos = glob('/pasta/*'); usort($arquivos, function($a, $b) { return filemtime($a) < filemtime($b); });…
-
20
votes2
answers389
viewsA: Android app for tablets only
You can enable/disable available screen types by updating your file’s support-screens entry AndroidManifest.xml: <manifest ... > <supports-screens android:smallScreens="false"…
-
3
votes1
answer355
viewsA: Doubt with relationship One to Many
Your problem is in solving the class name, add to your controller: use MagicCommerce\Site\Cadastros\Categoria; use MagicCommerce\Site\Cadastros\Produto;…
-
7
votes3
answers995
views -
8
votes1
answer576
viewsA: How to detect the error cause: 'The requested URL returned error: 503'?
The HTTP error code 503 means that the service requested from the WEB server is not available, Apache usually presents such an error when it cannot meet the request in question, several may be the…
-
2
votes1
answer716
viewsA: What are the right practices to handle events in PHP?
The Design Pattern Observer (also known as Publish-Subscribe) is actually a kind of one-to-many relationship between objects, i.e., when an object changes its state, the objects dependent are…
-
29
votes3
answers1402
viewsA: How can I simplify Urls for a website?
Method 1: PHP See a commented example: # Se o mod_rewrite estiver ativo <IfModule mod_rewrite.c> # Ativa a reescrita RewriteEngine On # Manuseia as requisições... # se a URL não descreve um…
-
1
votes1
answer146
viewsA: Error Expected SSH_FXP_VERSION when connecting via php with phpseclib
This error can be caused by several reasons, among them: Non-standard deployment of the SSH protocol on the router; phpseclib constants not defined correctly (mainly in some changes in it);…
-
1
votes4
answers2247
viewsA: What is the iterative (non-recursive) version of the LCA (Lower Common Ancestor) algorithm
Using the concept of Stack, at that link you can find an example of algorithm and implementation. In the example, we see how to cross the tree without using recursion, so the shortest distance can…
-
1
votes1
answer1006
viewsA: How do I use DOMPDF in Laravel 4 in conjunction with a BLADE view?
Helderam, the FPDF Package is actually the Facade that provides the FPDF within the Laravel 4 application. Headers and footers can be configured using the same methods as the FPDF alone. I recommend…
-
19
votes7
answers25439
viewsA: How to convert a JSON response to a C#object?
I recommend using the Json.NET Take the example of Documentation Product product = new Product(); product.Name = "Apple"; product.ExpiryDate = new DateTime(2008, 12, 28); product.Price = 3.99M;…
-
8
votes3
answers799
viewsA: Floats module in PHP returns integers?
The operator Module, server only for integers, for such use, you can use the function fmod of PHP: fmod(5.6, 3); // imprime 2.6 If you only use the Module operator (%), the value obtained will be…
-
0
votes3
answers8451
viewsA: Problem with uploading large files in PHP
You should edit in your file php.ini the two variables: post_max_size and upload_max_filesize in the standard PHP syntax format. Example: post_max_size = 100M upload_max_filesize = 100M…
-
8
votes2
answers2551
viewsA: Problem with @extends in view on Laravel.
Check if the files have the extension .Blade.php and not just .php To support other Template systems Laravel allows custom views, which do not use Blade, this is the case of the file hello.php, who…
-
0
votes2
answers830
viewsA: What is the most efficient way to calculate the Hashcode of an object in Javascript?
If the purpose is to compare two objects, you can try an isEqual() similar implementation of underscore.js http://documentcloud.github.io/underscore/docs/underscore.html#Section-88…
-
9
votes2
answers650
viewsA: How to use Packages in Laravel 4?
Composer simplifies and unifies the code distribution in PHP, there is not much difference, but Bundles for Laravel 3 are mostly not compatible with Laravel 4. By Composer, each package you want to…