Posts by Neimeg • 407 points
16 posts
-
0
votes0
answers262
viewsQ: How to check in the API if a user being searched in the database is the user who is logged in?
I am using Laravel and I need to create an attribute (is_me) in the model to know if the current profile belongs to the user who is logged in; I was doing as below, but now that I am using API I can…
-
0
votes0
answers58
viewsQ: Select last conversations by counting unread messages in each conversation
I have done a chat in Nodejs and I can already bring the list of conversations. However, I also need to bring the amount of unread messages from each conversation. Currently this query brings the…
-
8
votes1
answer501
viewsQ: Why Nodejs has versions 4.x, 5.x, 6.x and 0.1x.x, etc
Why Node.js exists in versions 4, 5 and 6, but also exists in versions 0.x.x. Or perhaps, what are the differences between the versions x.x and 0.x.x?
-
-1
votes1
answer909
viewsQ: Is there an image upload plugin for Summernote?
I want to use Summernote and I need to upload images, but I do not know how to do, there is some plugin for this (free preference or with accessible value)?
-
2
votes1
answer2038
viewsQ: How to edit HTML in a WYSIWYG (Tinymce) editor and save to the bank?
I currently have a blog about programming created by me and I’m using the Tinymce editor to create the content. I specifically use Tinymce because it has a free image upload plugin, which makes it…
-
0
votes1
answer69
viewsQ: How to take values from a JSON and pass as SASS variables with Grunt
I need to compile templates using Grunt and I want to put the color settings inside a JSON file that will be inside each layout folder, that is, I need to use Grunt to read JSON and pass the values…
-
0
votes1
answer987
viewsA: How to redirect to auth/login in Laravel 5.1 if visitor is not logged in?
I was making a mistake: ['prefix'=>'admin','before' => 'auth','middleware'=>['needsRole:Admin'],'namespace'=>'Admin'] When it really is:…
-
2
votes1
answer987
viewsQ: How to redirect to auth/login in Laravel 5.1 if visitor is not logged in?
I am using Laravel 5.1 native authentication but when accessing a protected route the system does not redirect me to the login screen, instead it shows me the message "You don’t have permission to…
-
1
votes0
answers117
viewsQ: Bad Request when logging in with Passport, Express and Nodejs
I am trying to authenticate a system but whenever I try to login (post) I get an error: 400 (bad request). On the console appears the message: The Character encoding of the Plain text Document was…
-
4
votes1
answer40
viewsQ: In Jade, how can I suppress the error if a variable does not exist?
I’m trying to create a form to create a user, but I use the same form to edit. When I try to create a new user the app shows me an error because in the form fields it tries to get information from a…
-
0
votes2
answers765
viewsA: Get script from a DIV with JS
As the question is in the "jQuery" category I will give the answer in jQuery: var div_form = $('#form'); var html = div_form.html(); if you do console.log(html); you will see the html code extracted…
-
1
votes1
answer75
viewsQ: How to migrate my website to Requirejs?
Currently I concateno all my Avascripts with Grunt sending the minified file to the page, but I know that a best practice is to use Requirejs to mudularizar everything, but I do not know how to…
-
0
votes1
answer357
viewsQ: Run javascript function on AJAX calls to a specific page
I have a site in Laravel where the content is dynamically loaded with AJAX, IE, in each call Laravel returns only the view of the part I need, in a certain page I need to initialize a jQuery plugin…
-
8
votes2
answers217
viewsQ: Risk in allowing developers to upem files. Blade
I’m developing a blog platform where users submit their template and Laravel uses this template to build the blog. The user/developer will only inform where the values will be, example:…
-
3
votes5
answers9733
viewsQ: How to get the index of a javascript object searching for the value?
I have such a JS object (fictitious values): { aifuw : 7, hsjwo : 5, hsgqk : 137, jskwe : 9483, NNNNN... : N... } I need to get the index where the value is 137. The ways I tried didn’t work out.…
-
0
votes1
answer1899
viewsQ: Access attribute of a JS object using the key of another attribute
I’m trying to get the value inside a given object using the key of another object: Ex: I have the objects: var obj1 = { id:'gh73f'} var obj2 = { gh73f : 123, h39sg : 764, c9wer : 921 } I tried to:…